diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-12-09 06:51:29 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-12-09 06:52:01 +0900 |
commit | 7cf0ed03f27c5facb4d1ca7edba33404290deee8 (patch) | |
tree | 0264e12717284a5a5268b0b129172659c2998354 | |
parent | 12caf7271655e16030e34279b1fb0b29a592f6ad (diff) | |
download | systemd-7cf0ed03f27c5facb4d1ca7edba33404290deee8.tar.gz |
network: route: show prefix length of the source in debugging logs
Similar fix to b489d6a26e44d430a997e756ac81767f6e646976.
-rw-r--r-- | src/network/networkd-route.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 82873e9a91..0693cbdee4 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; |