Skip to content

Commit

Permalink
ip_tunnel: Call ip_tunnel_core_init() from inet_init()
Browse files Browse the repository at this point in the history
Convert the module_init() to a invocation from inet_init() since
ip_tunnel_core is part of the INET built-in.

Fixes: 3093fbe ("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>
  • Loading branch information
Thomas Graf authored and David S. Miller committed Jul 23, 2015
1 parent c5e40ee commit 045a0fa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 2 additions & 0 deletions include/net/ip_tunnels.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ static inline int ip_tunnel_collect_metadata(void)
return static_key_false(&ip_tunnel_metadata_cnt);
}

void __init ip_tunnel_core_init(void);

void ip_tunnel_need_metadata(void);
void ip_tunnel_unneed_metadata(void);

Expand Down
3 changes: 3 additions & 0 deletions net/ipv4/af_inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
#include <net/raw.h>
#include <net/icmp.h>
#include <net/inet_common.h>
#include <net/ip_tunnels.h>
#include <net/xfrm.h>
#include <net/net_namespace.h>
#include <net/secure_seq.h>
Expand Down Expand Up @@ -1780,6 +1781,8 @@ static int __init inet_init(void)

dev_add_pack(&ip_packet_type);

ip_tunnel_core_init();

rc = 0;
out:
return rc;
Expand Down
11 changes: 1 addition & 10 deletions net/ipv4/ip_tunnel_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,19 +292,10 @@ static const struct lwtunnel_encap_ops ip_tun_lwt_ops = {
.get_encap_size = ip_tun_encap_nlsize,
};

static int __init ip_tunnel_core_init(void)
void __init ip_tunnel_core_init(void)
{
lwtunnel_encap_add_ops(&ip_tun_lwt_ops, LWTUNNEL_ENCAP_IP);

return 0;
}
module_init(ip_tunnel_core_init);

static void __exit ip_tunnel_core_exit(void)
{
lwtunnel_encap_del_ops(&ip_tun_lwt_ops, LWTUNNEL_ENCAP_IP);
}
module_exit(ip_tunnel_core_exit);

struct static_key ip_tunnel_metadata_cnt = STATIC_KEY_INIT_FALSE;
EXPORT_SYMBOL(ip_tunnel_metadata_cnt);
Expand Down

0 comments on commit 045a0fa

Please sign in to comment.