system-linux: only parse device status for AF_UNSPEC link messages master
authorFelix Fietkau <[email protected]>
Mon, 20 Oct 2025 21:35:20 +0000 (21:35 +0000)
committerFelix Fietkau <[email protected]>
Mon, 20 Oct 2025 21:37:36 +0000 (23:37 +0200)
In bridge messages (family = AF_BRIDGE), the commands are the same, but the
contents are different, and this can confuse netifd into thinking that devices
are down, while they are actually up.

Signed-off-by: Felix Fietkau <[email protected]>
system-linux.c

index ceeabe3a042a84e0746dad1e213d38aff0f55ef9..0160b300a6112145e938a060cda974c478f39195 100644 (file)
@@ -737,6 +737,9 @@ static int cb_rtnl_event(struct nl_msg *msg, void *arg)
        if (nh->nlmsg_type != RTM_NEWLINK && nh->nlmsg_type != RTM_DELLINK)
                return 0;
 
        if (nh->nlmsg_type != RTM_NEWLINK && nh->nlmsg_type != RTM_DELLINK)
                return 0;
 
+       if (ifi->ifi_family != AF_UNSPEC)
+               return 0;
+
        nlmsg_parse(nh, sizeof(struct ifinfomsg), nla, __IFLA_MAX - 1, NULL);
        if (!nla[IFLA_IFNAME])
                return 0;
        nlmsg_parse(nh, sizeof(struct ifinfomsg), nla, __IFLA_MAX - 1, NULL);
        if (!nla[IFLA_IFNAME])
                return 0;