Blob Blame History Raw
From: Michal Kubecek <mkubecek@suse.cz>
Date: Thu, 14 Feb 2019 13:38:05 +0100
Subject: kabi: restore ip_tunnel_delete_net()
Patch-mainline: Never, kabi workaround
References: bsc#1122982

Backport of mainline commit 64bc17811b72 ("ipv4: speedup ipv6 tunnels
dismantle") replaces exported function ip_tunnel_delete_net() deleting
tunnels in one network namespace by function ip_tunnel_delete_nets()
deleting tunnels in multiple network namespaces. Restore the old function
to preserve kabi.

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
 include/net/ip_tunnels.h |  1 +
 net/ipv4/ip_tunnel.c     | 11 +++++++++++
 2 files changed, 12 insertions(+)

--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -253,6 +253,7 @@ int ip_tunnel_get_iflink(const struct net_device *dev);
 int ip_tunnel_init_net(struct net *net, unsigned int ip_tnl_net_id,
 		       struct rtnl_link_ops *ops, char *devname);
 
+void ip_tunnel_delete_net(struct ip_tunnel_net *itn, struct rtnl_link_ops *ops);
 void ip_tunnel_delete_nets(struct list_head *list_net, unsigned int id,
 			   struct rtnl_link_ops *ops);
 
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -1062,6 +1062,17 @@ static void ip_tunnel_destroy(struct ip_tunnel_net *itn, struct list_head *head,
 	}
 }
 
+void ip_tunnel_delete_net(struct ip_tunnel_net *itn, struct rtnl_link_ops *ops)
+{
+	LIST_HEAD(list);
+
+	rtnl_lock();
+	ip_tunnel_destroy(itn, &list, ops);
+	unregister_netdevice_many(&list);
+	rtnl_unlock();
+}
+EXPORT_SYMBOL_GPL(ip_tunnel_delete_net);
+
 void ip_tunnel_delete_nets(struct list_head *net_list, unsigned int id,
 			   struct rtnl_link_ops *ops)
 {