aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/ip_gre.c2
-rw-r--r--net/ipv4/ip_tunnel.c8
-rw-r--r--net/ipv4/ip_vti.c1
-rw-r--r--net/ipv4/ipip.c1
4 files changed, 12 insertions, 0 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 942576e27df1..6e7727f27393 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -829,6 +829,7 @@ static struct rtnl_link_ops ipgre_link_ops __read_mostly = {
829 .dellink = ip_tunnel_dellink, 829 .dellink = ip_tunnel_dellink,
830 .get_size = ipgre_get_size, 830 .get_size = ipgre_get_size,
831 .fill_info = ipgre_fill_info, 831 .fill_info = ipgre_fill_info,
832 .get_link_net = ip_tunnel_get_link_net,
832}; 833};
833 834
834static struct rtnl_link_ops ipgre_tap_ops __read_mostly = { 835static struct rtnl_link_ops ipgre_tap_ops __read_mostly = {
@@ -843,6 +844,7 @@ static struct rtnl_link_ops ipgre_tap_ops __read_mostly = {
843 .dellink = ip_tunnel_dellink, 844 .dellink = ip_tunnel_dellink,
844 .get_size = ipgre_get_size, 845 .get_size = ipgre_get_size,
845 .fill_info = ipgre_fill_info, 846 .fill_info = ipgre_fill_info,
847 .get_link_net = ip_tunnel_get_link_net,
846}; 848};
847 849
848static int __net_init ipgre_tap_init_net(struct net *net) 850static int __net_init ipgre_tap_init_net(struct net *net)
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index d3e447936720..2cd08280c77b 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -972,6 +972,14 @@ void ip_tunnel_dellink(struct net_device *dev, struct list_head *head)
972} 972}
973EXPORT_SYMBOL_GPL(ip_tunnel_dellink); 973EXPORT_SYMBOL_GPL(ip_tunnel_dellink);
974 974
975struct net *ip_tunnel_get_link_net(const struct net_device *dev)
976{
977 struct ip_tunnel *tunnel = netdev_priv(dev);
978
979 return tunnel->net;
980}
981EXPORT_SYMBOL(ip_tunnel_get_link_net);
982
975int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, 983int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
976 struct rtnl_link_ops *ops, char *devname) 984 struct rtnl_link_ops *ops, char *devname)
977{ 985{
diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
index 1a7e979e80ba..94efe148181c 100644
--- a/net/ipv4/ip_vti.c
+++ b/net/ipv4/ip_vti.c
@@ -531,6 +531,7 @@ static struct rtnl_link_ops vti_link_ops __read_mostly = {
531 .dellink = ip_tunnel_dellink, 531 .dellink = ip_tunnel_dellink,
532 .get_size = vti_get_size, 532 .get_size = vti_get_size,
533 .fill_info = vti_fill_info, 533 .fill_info = vti_fill_info,
534 .get_link_net = ip_tunnel_get_link_net,
534}; 535};
535 536
536static int __init vti_init(void) 537static int __init vti_init(void)
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 40403114f00a..b58d6689874c 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -498,6 +498,7 @@ static struct rtnl_link_ops ipip_link_ops __read_mostly = {
498 .dellink = ip_tunnel_dellink, 498 .dellink = ip_tunnel_dellink,
499 .get_size = ipip_get_size, 499 .get_size = ipip_get_size,
500 .fill_info = ipip_fill_info, 500 .fill_info = ipip_fill_info,
501 .get_link_net = ip_tunnel_get_link_net,
501}; 502};
502 503
503static struct xfrm_tunnel ipip_handler __read_mostly = { 504static struct xfrm_tunnel ipip_handler __read_mostly = {