diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-02-10 00:50:24 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-02-12 01:49:59 +0900 |
commit | fe44ce8dba13b0322f05b74c90e35e4347da211f (patch) | |
tree | 4026e6076d0f0b5f2181e568a490e3faae3eb513 /src/network/networkd-address.c | |
parent | 1c3c43a4170efdc3ded2a9c469ad7d2a9df1746c (diff) | |
download | systemd-fe44ce8dba13b0322f05b74c90e35e4347da211f.tar.gz |
network: address: also logs preferred lifetime
Diffstat (limited to 'src/network/networkd-address.c')
-rw-r--r-- | src/network/networkd-address.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index b52a5f2e26..505851bafa 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -471,8 +471,8 @@ static void log_address_debug(const Address *address, const char *str, const Lin if (DEBUG_LOGGING) { _cleanup_free_ char *addr = NULL, *peer = NULL; - char valid_buf[FORMAT_TIMESPAN_MAX]; - const char *valid_str = NULL; + char valid_buf[FORMAT_TIMESPAN_MAX], preferred_buf[FORMAT_TIMESPAN_MAX]; + const char *valid_str = NULL, *preferred_str = NULL; bool has_peer; (void) in_addr_to_string(address->family, &address->in_addr, &addr); @@ -485,10 +485,16 @@ static void log_address_debug(const Address *address, const char *str, const Lin address->cinfo.ifa_valid * USEC_PER_SEC, USEC_PER_SEC); - log_link_debug(link, "%s address: %s%s%s/%u (valid %s%s)", + if (address->cinfo.ifa_prefered != CACHE_INFO_INFINITY_LIFE_TIME) + preferred_str = format_timespan(preferred_buf, FORMAT_TIMESPAN_MAX, + address->cinfo.ifa_prefered * USEC_PER_SEC, + USEC_PER_SEC); + + log_link_debug(link, "%s address: %s%s%s/%u (valid %s%s, preferred %s%s)", str, strnull(addr), has_peer ? " peer " : "", has_peer ? strnull(peer) : "", address->prefixlen, - valid_str ? "for " : "forever", strempty(valid_str)); + valid_str ? "for " : "forever", strempty(valid_str), + preferred_str ? "for " : "forever", strempty(preferred_str)); } } |