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
8a87a91813 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.
This commit is contained in:
Thomas Haller
2017-08-31 17:47:16 +02:00
parent 5c5a553ca6
commit 35f189f1eb

View File

@@ -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: