]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/nexthop: drop outdated comment and add one debugging log
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 20 Nov 2024 17:09:08 +0000 (02:09 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 11 Dec 2024 02:21:14 +0000 (11:21 +0900)
All NextHop objects are managed by Manager since
352eba2e49453a1b784ffbdb9509ba3f8a945b59.

src/network/networkd-nexthop.c

index 8e101ad779b5b2ed186b6a515c8d551a5ab19a03..ab4bafba50d702e50d14a29786e49245d7aee9b5 100644 (file)
@@ -1199,10 +1199,12 @@ int manager_rtnl_process_nexthop(sd_netlink *rtnl, sd_netlink_message *message,
         else
                 nexthop->ifindex = (int) ifindex;
 
-        /* All blackhole or group nexthops are managed by Manager. Note that the linux kernel does not
-         * set NHA_OID attribute when NHA_BLACKHOLE or NHA_GROUP is set. Just for safety. */
-        if (!nexthop_bound_to_link(nexthop))
+        /* The linux kernel does not set NHA_OID attribute when NHA_BLACKHOLE or NHA_GROUP is set.
+         * But let's check that for safety. */
+        if (!nexthop_bound_to_link(nexthop) && nexthop->ifindex != 0) {
+                log_debug("rtnl: received blackhole or group nexthop with NHA_OIF attribute, ignoring the attribute.");
                 nexthop->ifindex = 0;
+        }
 
         nexthop_enter_configured(nexthop);
         if (req)