diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2015-01-15 09:11:17 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-19 14:32:03 -0500 |
commit | 1728d4fabd1bc9965728de25dda0b694b8da6450 (patch) | |
tree | ded88a9a2a0c6feb7374093f4ba85debcb0ee894 /net/ipv4 | |
parent | d37512a277dfb2cef8a578e25a3246f61399a55a (diff) |
tunnels: advertise link netns via netlink
Implement rtnl_link_ops->get_link_net() callback so that IFLA_LINK_NETNSID is
added to rtnetlink messages.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_gre.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_tunnel.c | 8 | ||||
-rw-r--r-- | net/ipv4/ip_vti.c | 1 | ||||
-rw-r--r-- | net/ipv4/ipip.c | 1 |
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 | ||
834 | static struct rtnl_link_ops ipgre_tap_ops __read_mostly = { | 835 | static 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 | ||
848 | static int __net_init ipgre_tap_init_net(struct net *net) | 850 | static 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 | } |
973 | EXPORT_SYMBOL_GPL(ip_tunnel_dellink); | 973 | EXPORT_SYMBOL_GPL(ip_tunnel_dellink); |
974 | 974 | ||
975 | struct 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 | } | ||
981 | EXPORT_SYMBOL(ip_tunnel_get_link_net); | ||
982 | |||
975 | int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, | 983 | int 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 | ||
536 | static int __init vti_init(void) | 537 | static 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 | ||
503 | static struct xfrm_tunnel ipip_handler __read_mostly = { | 504 | static struct xfrm_tunnel ipip_handler __read_mostly = { |