]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: route: logs null address with non-zero prefixlen correctly
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 5 Dec 2021 15:27:43 +0000 (00:27 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 6 Dec 2021 10:16:17 +0000 (19:16 +0900)
src/network/networkd-route.c

index 20d6aa47f6609f894ea52dc53a557224fc219c98..003c8dcde49b9576caae36eb735b8930654e7805 100644 (file)
@@ -558,7 +558,7 @@ static void log_route_debug(const Route *route, const char *str, const Link *lin
                 return;
 
         (void) network_config_state_to_string_alloc(route->state, &state);
-        if (in_addr_is_set(route->family, &route->dst))
+        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);