diff options
author | David S. Miller <davem@davemloft.net> | 2016-06-14 22:21:45 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-14 22:21:45 -0700 |
commit | 61e0979a497b07f5a82f3050e37ecc7093e2971d (patch) | |
tree | 47ed9f32de8b902a77fce32f25d121b90f007f87 /net | |
parent | d1e37288c9146dccff830e3253e403af8705b51f (diff) | |
parent | 41009481b690493c169ce85f591b9d32c6fd9422 (diff) | |
download | linux-stable-61e0979a497b07f5a82f3050e37ecc7093e2971d.tar.gz linux-stable-61e0979a497b07f5a82f3050e37ecc7093e2971d.tar.bz2 linux-stable-61e0979a497b07f5a82f3050e37ecc7093e2971d.zip |
Merge branch 'ovs-notifications'
Nicolas Dichtel says:
====================
ovs: fix rtnl notifications on interface deletion
There was no rtnl notifications for interfaces (gre, vxlan, geneve) created
by ovs. This problem is fixed by adjusting the creation path.
v1 -> v2:
- add patch #1 and #4
- rework error handling in patch #2
====================
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ip_gre.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 4d2025f7ec57..07c5cf1838d8 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -1121,6 +1121,7 @@ struct net_device *gretap_fb_dev_create(struct net *net, const char *name, { struct nlattr *tb[IFLA_MAX + 1]; struct net_device *dev; + LIST_HEAD(list_kill); struct ip_tunnel *t; int err; @@ -1136,8 +1137,10 @@ struct net_device *gretap_fb_dev_create(struct net *net, const char *name, t->collect_md = true; err = ipgre_newlink(net, dev, tb, NULL); - if (err < 0) - goto out; + if (err < 0) { + free_netdev(dev); + return ERR_PTR(err); + } /* openvswitch users expect packet sizes to be unrestricted, * so set the largest MTU we can. @@ -1146,9 +1149,14 @@ struct net_device *gretap_fb_dev_create(struct net *net, const char *name, if (err) goto out; + err = rtnl_configure_link(dev, NULL); + if (err < 0) + goto out; + return dev; out: - free_netdev(dev); + ip_tunnel_dellink(dev, &list_kill); + unregister_netdevice_many(&list_kill); return ERR_PTR(err); } EXPORT_SYMBOL_GPL(gretap_fb_dev_create); |