From: Yu Watanabe Date: Wed, 28 Aug 2019 23:13:15 +0000 (+0900) Subject: network: do not use implicit cast to boolean X-Git-Tag: v244-rc1~300^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=70dc23624e6adf207187a20ed96cb1f580e3badc;p=thirdparty%2Fsystemd.git network: do not use implicit cast to boolean --- diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 19055f4e48e..9a908793619 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -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");