From: Yu Watanabe Date: Wed, 8 Dec 2021 21:51:29 +0000 (+0900) Subject: network: route: show prefix length of the source in debugging logs X-Git-Tag: v250-rc1~13^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cf0ed03f27c5facb4d1ca7edba33404290deee8;p=thirdparty%2Fsystemd.git network: route: show prefix length of the source in debugging logs Similar fix to b489d6a26e44d430a997e756ac81767f6e646976. --- diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 82873e9a916..0693cbdee44 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -560,8 +560,8 @@ static void log_route_debug(const Route *route, const char *str, const Link *lin (void) network_config_state_to_string_alloc(route->state, &state); if (in_addr_is_set(route->family, &route->dst) || route->dst_prefixlen > 0) (void) in_addr_prefix_to_string(route->family, &route->dst, route->dst_prefixlen, &dst); - if (in_addr_is_set(route->family, &route->src)) - (void) in_addr_to_string(route->family, &route->src, &src); + if (in_addr_is_set(route->family, &route->src) || route->src_prefixlen > 0) + (void) in_addr_prefix_to_string(route->family, &route->src, route->src_prefixlen, &src); if (in_addr_is_set(route->gw_family, &route->gw)) { (void) in_addr_to_string(route->gw_family, &route->gw, &gw_alloc); gw = gw_alloc;