aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2015-01-15 09:11:17 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-19 14:32:03 -0500
commit1728d4fabd1bc9965728de25dda0b694b8da6450 (patch)
treeded88a9a2a0c6feb7374093f4ba85debcb0ee894 /net/ipv6
parentd37512a277dfb2cef8a578e25a3246f61399a55a (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/ipv6')
-rw-r--r--net/ipv6/ip6_gre.c1
-rw-r--r--net/ipv6/ip6_tunnel.c9
-rw-r--r--net/ipv6/ip6_vti.c1
-rw-r--r--net/ipv6/sit.c1
4 files changed, 12 insertions, 0 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 13cda4c6313b..9306a5ff9149 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -1662,6 +1662,7 @@ static struct rtnl_link_ops ip6gre_link_ops __read_mostly = {
1662 .dellink = ip6gre_dellink, 1662 .dellink = ip6gre_dellink,
1663 .get_size = ip6gre_get_size, 1663 .get_size = ip6gre_get_size,
1664 .fill_info = ip6gre_fill_info, 1664 .fill_info = ip6gre_fill_info,
1665 .get_link_net = ip6_tnl_get_link_net,
1665}; 1666};
1666 1667
1667static struct rtnl_link_ops ip6gre_tap_ops __read_mostly = { 1668static struct rtnl_link_ops ip6gre_tap_ops __read_mostly = {
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 92b3da571980..266a264ec212 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1760,6 +1760,14 @@ nla_put_failure:
1760 return -EMSGSIZE; 1760 return -EMSGSIZE;
1761} 1761}
1762 1762
1763struct net *ip6_tnl_get_link_net(const struct net_device *dev)
1764{
1765 struct ip6_tnl *tunnel = netdev_priv(dev);
1766
1767 return tunnel->net;
1768}
1769EXPORT_SYMBOL(ip6_tnl_get_link_net);
1770
1763static const struct nla_policy ip6_tnl_policy[IFLA_IPTUN_MAX + 1] = { 1771static const struct nla_policy ip6_tnl_policy[IFLA_IPTUN_MAX + 1] = {
1764 [IFLA_IPTUN_LINK] = { .type = NLA_U32 }, 1772 [IFLA_IPTUN_LINK] = { .type = NLA_U32 },
1765 [IFLA_IPTUN_LOCAL] = { .len = sizeof(struct in6_addr) }, 1773 [IFLA_IPTUN_LOCAL] = { .len = sizeof(struct in6_addr) },
@@ -1783,6 +1791,7 @@ static struct rtnl_link_ops ip6_link_ops __read_mostly = {
1783 .dellink = ip6_tnl_dellink, 1791 .dellink = ip6_tnl_dellink,
1784 .get_size = ip6_tnl_get_size, 1792 .get_size = ip6_tnl_get_size,
1785 .fill_info = ip6_tnl_fill_info, 1793 .fill_info = ip6_tnl_fill_info,
1794 .get_link_net = ip6_tnl_get_link_net,
1786}; 1795};
1787 1796
1788static struct xfrm6_tunnel ip4ip6_handler __read_mostly = { 1797static struct xfrm6_tunnel ip4ip6_handler __read_mostly = {
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
index ace10d0b3aac..5fb9e212eca8 100644
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -1016,6 +1016,7 @@ static struct rtnl_link_ops vti6_link_ops __read_mostly = {
1016 .changelink = vti6_changelink, 1016 .changelink = vti6_changelink,
1017 .get_size = vti6_get_size, 1017 .get_size = vti6_get_size,
1018 .fill_info = vti6_fill_info, 1018 .fill_info = vti6_fill_info,
1019 .get_link_net = ip6_tnl_get_link_net,
1019}; 1020};
1020 1021
1021static void __net_exit vti6_destroy_tunnels(struct vti6_net *ip6n) 1022static void __net_exit vti6_destroy_tunnels(struct vti6_net *ip6n)
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 213546bd6d5d..3cc197c72b59 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1763,6 +1763,7 @@ static struct rtnl_link_ops sit_link_ops __read_mostly = {
1763 .get_size = ipip6_get_size, 1763 .get_size = ipip6_get_size,
1764 .fill_info = ipip6_fill_info, 1764 .fill_info = ipip6_fill_info,
1765 .dellink = ipip6_dellink, 1765 .dellink = ipip6_dellink,
1766 .get_link_net = ip_tunnel_get_link_net,
1766}; 1767};
1767 1768
1768static struct xfrm_tunnel sit_handler __read_mostly = { 1769static struct xfrm_tunnel sit_handler __read_mostly = {