diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-07-07 08:35:53 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-07-07 12:11:37 +0200 |
commit | 14044a41144e9b793317c90e6b8a53bc05d759f7 (patch) | |
tree | 1cc8ee024fe4c2a03a95a6f8be23a23592106157 /src/network/networkd-address.c | |
parent | network: ignore Broadcast= setting when the address is null (diff) | |
download | systemd-14044a41144e9b793317c90e6b8a53bc05d759f7.tar.xz systemd-14044a41144e9b793317c90e6b8a53bc05d759f7.zip |
network: log broadcast address and address label
Diffstat (limited to 'src/network/networkd-address.c')
-rw-r--r-- | src/network/networkd-address.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index e0a7b1c169..b5a4041c07 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -708,16 +708,22 @@ static void log_address_debug(const Address *address, const char *str, const Lin const char *peer = in_addr_is_set(address->family, &address->in_addr_peer) ? IN_ADDR_TO_STRING(address->family, &address->in_addr_peer) : NULL; + const char *broadcast = (address->family == AF_INET && in4_addr_is_set(&address->broadcast)) ? + IN4_ADDR_TO_STRING(&address->broadcast) : NULL; + (void) address_flags_to_string_alloc(address->flags, address->family, &flags_str); (void) route_scope_to_string_alloc(address->scope, &scope_str); - log_link_debug(link, "%s %s address (%s): %s%s%s/%u (valid %s, preferred %s), flags: %s, scope: %s", + log_link_debug(link, "%s %s address (%s): %s%s%s/%u%s%s (valid %s, preferred %s), flags: %s, scope: %s%s%s", str, strna(network_config_source_to_string(address->source)), strna(state), IN_ADDR_TO_STRING(address->family, &address->in_addr), peer ? " peer " : "", strempty(peer), address->prefixlen, + broadcast ? " broadcast " : "", strempty(broadcast), FORMAT_LIFETIME(address->lifetime_valid_usec), FORMAT_LIFETIME(address->lifetime_preferred_usec), - strna(flags_str), strna(scope_str)); + strna(flags_str), strna(scope_str), + address->family == AF_INET ? ", label: " : "", + address->family == AF_INET ? strna(address->label) : ""); } static int address_set_netlink_message(const Address *address, sd_netlink_message *m, Link *link) { |