diff options
author | Thomas Haller <thaller@redhat.com> | 2018-04-05 15:14:10 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-04-09 20:16:30 +0200 |
commit | 722f79c9c563192a46dddb921bfc00c24687f2ff (patch) | |
tree | e73303328ae9d37f6105b9b7466ade0cb9f7a666 | |
parent | f76a94668ddd4b5e1385a0daf6c8925674f9ef18 (diff) | |
download | NetworkManager-722f79c9c563192a46dddb921bfc00c24687f2ff.tar.gz |
platform: workaround kernel issue for tun device for first RTM_NETLINK event
Due to a bug, the current rc-kernel will emit the first netlink
notification about tun devices before the device is initialized.
Hence, the content of the message is bogus. If the message
looks like to be this case, re-request it right away.
-rw-r--r-- | src/platform/nm-linux-platform.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 3c01d3d36e..8923708657 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -3931,6 +3931,7 @@ cache_on_change (NMPlatform *platform, && (!obj_old || !obj_old->_link.netlink.is_in_netlink)) { gboolean re_request_link = FALSE; + const NMPlatformLnkTun *lnk_tun; if ( !obj_new->_link.netlink.lnk && NM_IN_SET (obj_new->link.type, NM_LINK_TYPE_GRE, @@ -3948,6 +3949,19 @@ cache_on_change (NMPlatform *platform, * * For example https://bugzilla.redhat.com/show_bug.cgi?id=1284001 */ re_request_link = TRUE; + } else if ( obj_new->link.type == NM_LINK_TYPE_TUN + && obj_new->_link.netlink.lnk + && (lnk_tun = &(obj_new->_link.netlink.lnk)->lnk_tun) + && !lnk_tun->persist + && lnk_tun->pi + && !lnk_tun->vnet_hdr + && !lnk_tun->multi_queue + && !lnk_tun->owner_valid + && !lnk_tun->group_valid) { + /* kernel has/had a know issue that the first notification for TUN device would + * be sent with invalid parameters. The message looks like that kind, so refetch + * it. */ + re_request_link = TRUE; } else if ( obj_new->link.type == NM_LINK_TYPE_VETH && obj_new->link.parent == 0) { /* the initial notification when adding a veth pair can lack the parent/IFLA_LINK |