]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/route-nexthop: fix route_nexthop_copy()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 19 Jan 2024 10:19:01 +0000 (19:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 19 Jan 2024 10:20:21 +0000 (19:20 +0900)
Follow-up for 413ea20ab3d86b5bccf775da21a945327b3880c9.

src/network/networkd-route-nexthop.c

index 9e14c695be12bed795be1a0b519ec71d034fa44c..639302db715478c7ce38f96bf1c573c58be78e56 100644 (file)
@@ -179,7 +179,7 @@ static int route_nexthop_copy(const RouteNextHop *src, RouteNextHop *dest) {
         /* unset pointer copied in the above. */
         dest->ifname = NULL;
 
-        return strdup_or_null(src->ifindex == 0 ? NULL : src->ifname, &dest->ifname);
+        return strdup_or_null(src->ifindex > 0 ? NULL : src->ifname, &dest->ifname);
 }
 
 int route_nexthops_copy(const Route *src, const RouteNextHop *nh, Route *dest) {