]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: do not use implicit cast to boolean
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 28 Aug 2019 23:13:15 +0000 (08:13 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 15 Sep 2019 13:33:11 +0000 (22:33 +0900)
src/network/networkd-route.c

index 19055f4e48e8fcb5df0d3bf1b8ec3c44906a7d70..9a90879361980dc0e237617b3e55f56e7f978dfa 100644 (file)
@@ -680,7 +680,7 @@ int route_configure(
                         return log_link_error_errno(link, r, "Could not set route family: %m");
         }
 
-        if (route->dst_prefixlen) {
+        if (route->dst_prefixlen > 0) {
                 r = netlink_message_append_in_addr_union(req, RTA_DST, route->family, &route->dst);
                 if (r < 0)
                         return log_link_error_errno(link, r, "Could not append RTA_DST attribute: %m");
@@ -690,7 +690,7 @@ int route_configure(
                         return log_link_error_errno(link, r, "Could not set destination prefix length: %m");
         }
 
-        if (route->src_prefixlen) {
+        if (route->src_prefixlen > 0) {
                 r = netlink_message_append_in_addr_union(req, RTA_SRC, route->family, &route->src);
                 if (r < 0)
                         return log_link_error_errno(link, r, "Could not append RTA_SRC attribute: %m");