summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-11-26 15:48:32 +0100
committerThomas Haller <thaller@redhat.com>2015-11-27 14:22:06 +0100
commit4488cf690344703573190177b4b386578a77b277 (patch)
tree75dd2a2410bac5d10a641f8ca88efe5d88aff182
parent557c495326069a870a1b785878b48244d777c981 (diff)
downloadNetworkManager-4488cf690344703573190177b4b386578a77b277.tar.gz
platform: add workaround for incomplete netlink link messages
Due to kernel bugs [1], the first netlink event about a new link sometimes lacks the IFLA_LINKINFO with the link-type lnk data. In the case the data is missing, schedule a re-fetch the link hoping that it gets send. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1284001
-rw-r--r--src/platform/nm-linux-platform.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index b7506e7d1c..b68df0da2e 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -2778,6 +2778,31 @@ cache_pre_hook (NMPCache *cache, const NMPObject *old, const NMPObject *new, NMP
NULL);
}
}
+ if ( NM_IN_SET (ops_type, NMP_CACHE_OPS_ADDED, NMP_CACHE_OPS_UPDATED)
+ && (new && new->_link.netlink.is_in_netlink)
+ && (!old || !old->_link.netlink.is_in_netlink))
+ {
+ if (!new->_link.netlink.lnk) {
+ /* certain link-types also come with a IFLA_INFO_DATA/lnk_data. It may happen that
+ * kernel didn't send this notification, thus when we first learn about a link
+ * that lacks an lnk_data we re-request it again.
+ *
+ * For example https://bugzilla.redhat.com/show_bug.cgi?id=1284001 */
+ switch (new->link.type) {
+ case NM_LINK_TYPE_GRE:
+ case NM_LINK_TYPE_INFINIBAND:
+ case NM_LINK_TYPE_MACVLAN:
+ case NM_LINK_TYPE_VLAN:
+ case NM_LINK_TYPE_VXLAN:
+ delayed_action_schedule (platform,
+ DELAYED_ACTION_TYPE_REFRESH_LINK,
+ GINT_TO_POINTER (new->link.ifindex));
+ break;
+ default:
+ break;
+ }
+ }
+ }
{
/* on enslave/release, we also refresh the master. */
int ifindex1 = 0, ifindex2 = 0;