From 35f189f1eb1dfca82d2f768f8c69cfd03a1f199e Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 31 Aug 2017 17:47:16 +0200 Subject: [PATCH] platform: ignore RTM_*LINK messages for unknown ifi_family (AF_BRIDGE) When unenslaving an interface from a bridge, kernel sends a RTM_DELLINK message with ifi_family AF_BRIDGE. We only care about regular RTM_DELLINK/RTM_NEWLINK messages, ignore all but ifi_family AF_UNSPEC. There is also test_nl_bugs_spuroius_dellink(), added in commit 8a87a918130e959f78b5f00db14591b604a07505 for related bug rh#1302037. The workaround was masking a bug in NetworkManager (to not ignore AF_BRIDGE messages) and can now be removed as well. --- src/platform/nm-linux-platform.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 4ca3d9458..ff7fc71b6 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -1672,6 +1672,9 @@ _new_from_nl_link (NMPlatform *platform, const NMPCache *cache, struct nlmsghdr return NULL; ifi = nlmsg_data(nlh); + if (ifi->ifi_family != AF_UNSPEC) + return NULL; + obj = nmp_object_new_link (ifi->ifi_index); if (id_only) @@ -3682,22 +3685,6 @@ cache_on_change (NMPlatform *platform, delayed_action_schedule (platform, DELAYED_ACTION_TYPE_REFRESH_LINK, GINT_TO_POINTER (ifindex2)); } } - { - if ( ( (cache_op == NMP_CACHE_OPS_REMOVED) - || ( (cache_op == NMP_CACHE_OPS_UPDATED) - && obj_new - && !obj_new->_link.netlink.is_in_netlink)) - && obj_old - && obj_old->_link.netlink.is_in_netlink - && obj_old->link.master) { - /* sometimes we receive a wrong RTM_DELLINK message when unslaving - * a device. Refetch the link again to check whether the device - * is really gone. - * - * https://bugzilla.redhat.com/show_bug.cgi?id=1285719#c2 */ - delayed_action_schedule (platform, DELAYED_ACTION_TYPE_REFRESH_LINK, GINT_TO_POINTER (obj_old->link.ifindex)); - } - } break; case NMP_OBJECT_TYPE_IP4_ADDRESS: case NMP_OBJECT_TYPE_IP6_ADDRESS: