aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2015-07-23 04:08:44 -0400
committerDavid S. Miller <davem@davemloft.net>2015-07-23 04:28:21 -0400
commit045a0fa0c5f5ea0f16c009f924ea579634afbba8 (patch)
tree10037431a845453ca3942ccbe9a8ebb413baa212
parentc5e40ee287db61a79af1746954ee03ebbf1ff8a3 (diff)
ip_tunnel: Call ip_tunnel_core_init() from inet_init()
Convert the module_init() to a invocation from inet_init() since ip_tunnel_core is part of the INET built-in. Fixes: 3093fbe7ff4 ("route: Per route IP tunnel metadata via lightweight tunnel") Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/ip_tunnels.h2
-rw-r--r--net/ipv4/af_inet.c3
-rw-r--r--net/ipv4/ip_tunnel_core.c11
3 files changed, 6 insertions, 10 deletions
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index d975b3ebd6c7..47984415f5d1 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -311,6 +311,8 @@ static inline int ip_tunnel_collect_metadata(void)
311 return static_key_false(&ip_tunnel_metadata_cnt); 311 return static_key_false(&ip_tunnel_metadata_cnt);
312} 312}
313 313
314void __init ip_tunnel_core_init(void);
315
314void ip_tunnel_need_metadata(void); 316void ip_tunnel_need_metadata(void);
315void ip_tunnel_unneed_metadata(void); 317void ip_tunnel_unneed_metadata(void);
316 318
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 9532ee87151f..cc4e498a0ccf 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -112,6 +112,7 @@
112#include <net/raw.h> 112#include <net/raw.h>
113#include <net/icmp.h> 113#include <net/icmp.h>
114#include <net/inet_common.h> 114#include <net/inet_common.h>
115#include <net/ip_tunnels.h>
115#include <net/xfrm.h> 116#include <net/xfrm.h>
116#include <net/net_namespace.h> 117#include <net/net_namespace.h>
117#include <net/secure_seq.h> 118#include <net/secure_seq.h>
@@ -1780,6 +1781,8 @@ static int __init inet_init(void)
1780 1781
1781 dev_add_pack(&ip_packet_type); 1782 dev_add_pack(&ip_packet_type);
1782 1783
1784 ip_tunnel_core_init();
1785
1783 rc = 0; 1786 rc = 0;
1784out: 1787out:
1785 return rc; 1788 return rc;
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
index 630e6d5712e8..5512f4e4ec1b 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -292,19 +292,10 @@ static const struct lwtunnel_encap_ops ip_tun_lwt_ops = {
292 .get_encap_size = ip_tun_encap_nlsize, 292 .get_encap_size = ip_tun_encap_nlsize,
293}; 293};
294 294
295static int __init ip_tunnel_core_init(void) 295void __init ip_tunnel_core_init(void)
296{ 296{
297 lwtunnel_encap_add_ops(&ip_tun_lwt_ops, LWTUNNEL_ENCAP_IP); 297 lwtunnel_encap_add_ops(&ip_tun_lwt_ops, LWTUNNEL_ENCAP_IP);
298
299 return 0;
300}
301module_init(ip_tunnel_core_init);
302
303static void __exit ip_tunnel_core_exit(void)
304{
305 lwtunnel_encap_del_ops(&ip_tun_lwt_ops, LWTUNNEL_ENCAP_IP);
306} 298}
307module_exit(ip_tunnel_core_exit);
308 299
309struct static_key ip_tunnel_metadata_cnt = STATIC_KEY_INIT_FALSE; 300struct static_key ip_tunnel_metadata_cnt = STATIC_KEY_INIT_FALSE;
310EXPORT_SYMBOL(ip_tunnel_metadata_cnt); 301EXPORT_SYMBOL(ip_tunnel_metadata_cnt);