]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/neighbor: suppress noisy debugging logs
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 12 Nov 2023 13:12:26 +0000 (22:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 12 Nov 2023 18:58:46 +0000 (03:58 +0900)
- AF_BRIDGE is not invalid. But we are not interested in it, currently.
- Also, we are not interested in non-static neighbors, at least
  currently,
- As already commented, the kernel sends message about neighbors after
  sending RTM_DELLINK. In that case, the corresponding Link object is
  already removed, and there is nothing we need to do in that case.

src/network/networkd-neighbor.c

index c4e1c463c45ef33437f5fdd84247c049d3f74560..e9986567ac7a0b92f41874f26e31e3654cdd514f 100644 (file)
@@ -510,10 +510,9 @@ int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message,
         if (r < 0) {
                 log_warning_errno(r, "rtnl: received neighbor message with invalid state, ignoring: %m");
                 return 0;
-        } else if (!FLAGS_SET(state, NUD_PERMANENT)) {
-                log_debug("rtnl: received non-static neighbor, ignoring.");
+        } else if (!FLAGS_SET(state, NUD_PERMANENT))
+                /* Currently, we are interested in only static neighbors. */
                 return 0;
-        }
 
         r = sd_rtnl_message_neigh_get_ifindex(message, &ifindex);
         if (r < 0) {
@@ -525,12 +524,10 @@ int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message,
         }
 
         r = link_get_by_index(m, ifindex, &link);
-        if (r < 0) {
+        if (r < 0)
                 /* when enumerating we might be out of sync, but we will get the neighbor again. Also,
                  * kernel sends messages about neighbors after a link is removed. So, just ignore it. */
-                log_debug("rtnl: received neighbor for link '%d' we don't know about, ignoring.", ifindex);
                 return 0;
-        }
 
         tmp = new0(Neighbor, 1);
 
@@ -539,7 +536,10 @@ int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message,
         if (r < 0) {
                 log_link_warning(link, "rtnl: received neighbor message without family, ignoring.");
                 return 0;
-        } else if (!IN_SET(tmp->family, AF_INET, AF_INET6)) {
+        }
+        if (tmp->family == AF_BRIDGE) /* Currently, we do not support it. */
+                return 0;
+        if (!IN_SET(tmp->family, AF_INET, AF_INET6)) {
                 log_link_debug(link, "rtnl: received neighbor message with invalid family '%i', ignoring.", tmp->family);
                 return 0;
         }