aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2015-04-02 11:07:01 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-02 14:04:59 -0400
commitecf2c06a88d2ed534a87b84b8c1a467ab23352dd (patch)
treeab6cbc9125c1b34fa2bded7795bc6c30505f72d5 /net/ipv6
parenta54acb3a6f853e8394c4cb7b6a4d93c88f13eefd (diff)
ip6tnl,gre6,vti6: implement ndo_get_iflink
Don't use dev->iflink anymore. CC: Steffen Klassert <steffen.klassert@secunet.com> 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.c8
-rw-r--r--net/ipv6/ip6_tunnel.c10
-rw-r--r--net/ipv6/ip6_vti.c3
3 files changed, 11 insertions, 10 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 0f4e73da14e4..f724329d7436 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -1216,6 +1216,7 @@ static const struct net_device_ops ip6gre_netdev_ops = {
1216 .ndo_do_ioctl = ip6gre_tunnel_ioctl, 1216 .ndo_do_ioctl = ip6gre_tunnel_ioctl,
1217 .ndo_change_mtu = ip6gre_tunnel_change_mtu, 1217 .ndo_change_mtu = ip6gre_tunnel_change_mtu,
1218 .ndo_get_stats64 = ip_tunnel_get_stats64, 1218 .ndo_get_stats64 = ip_tunnel_get_stats64,
1219 .ndo_get_iflink = ip6_tnl_get_iflink,
1219}; 1220};
1220 1221
1221static void ip6gre_dev_free(struct net_device *dev) 1222static void ip6gre_dev_free(struct net_device *dev)
@@ -1238,7 +1239,6 @@ static void ip6gre_tunnel_setup(struct net_device *dev)
1238 if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) 1239 if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT))
1239 dev->mtu -= 8; 1240 dev->mtu -= 8;
1240 dev->flags |= IFF_NOARP; 1241 dev->flags |= IFF_NOARP;
1241 dev->iflink = 0;
1242 dev->addr_len = sizeof(struct in6_addr); 1242 dev->addr_len = sizeof(struct in6_addr);
1243 netif_keep_dst(dev); 1243 netif_keep_dst(dev);
1244} 1244}
@@ -1270,8 +1270,6 @@ static int ip6gre_tunnel_init(struct net_device *dev)
1270 u64_stats_init(&ip6gre_tunnel_stats->syncp); 1270 u64_stats_init(&ip6gre_tunnel_stats->syncp);
1271 } 1271 }
1272 1272
1273 dev->iflink = tunnel->parms.link;
1274
1275 return 0; 1273 return 0;
1276} 1274}
1277 1275
@@ -1480,8 +1478,6 @@ static int ip6gre_tap_init(struct net_device *dev)
1480 if (!dev->tstats) 1478 if (!dev->tstats)
1481 return -ENOMEM; 1479 return -ENOMEM;
1482 1480
1483 dev->iflink = tunnel->parms.link;
1484
1485 return 0; 1481 return 0;
1486} 1482}
1487 1483
@@ -1493,6 +1489,7 @@ static const struct net_device_ops ip6gre_tap_netdev_ops = {
1493 .ndo_validate_addr = eth_validate_addr, 1489 .ndo_validate_addr = eth_validate_addr,
1494 .ndo_change_mtu = ip6gre_tunnel_change_mtu, 1490 .ndo_change_mtu = ip6gre_tunnel_change_mtu,
1495 .ndo_get_stats64 = ip_tunnel_get_stats64, 1491 .ndo_get_stats64 = ip_tunnel_get_stats64,
1492 .ndo_get_iflink = ip6_tnl_get_iflink,
1496}; 1493};
1497 1494
1498static void ip6gre_tap_setup(struct net_device *dev) 1495static void ip6gre_tap_setup(struct net_device *dev)
@@ -1503,7 +1500,6 @@ static void ip6gre_tap_setup(struct net_device *dev)
1503 dev->netdev_ops = &ip6gre_tap_netdev_ops; 1500 dev->netdev_ops = &ip6gre_tap_netdev_ops;
1504 dev->destructor = ip6gre_dev_free; 1501 dev->destructor = ip6gre_dev_free;
1505 1502
1506 dev->iflink = 0;
1507 dev->features |= NETIF_F_NETNS_LOCAL; 1503 dev->features |= NETIF_F_NETNS_LOCAL;
1508} 1504}
1509 1505
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 9bd85f0dff69..b6a211a150b2 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1264,8 +1264,6 @@ static void ip6_tnl_link_config(struct ip6_tnl *t)
1264 else 1264 else
1265 dev->flags &= ~IFF_POINTOPOINT; 1265 dev->flags &= ~IFF_POINTOPOINT;
1266 1266
1267 dev->iflink = p->link;
1268
1269 if (p->flags & IP6_TNL_F_CAP_XMIT) { 1267 if (p->flags & IP6_TNL_F_CAP_XMIT) {
1270 int strict = (ipv6_addr_type(&p->raddr) & 1268 int strict = (ipv6_addr_type(&p->raddr) &
1271 (IPV6_ADDR_MULTICAST|IPV6_ADDR_LINKLOCAL)); 1269 (IPV6_ADDR_MULTICAST|IPV6_ADDR_LINKLOCAL));
@@ -1517,6 +1515,13 @@ ip6_tnl_change_mtu(struct net_device *dev, int new_mtu)
1517 return 0; 1515 return 0;
1518} 1516}
1519 1517
1518int ip6_tnl_get_iflink(const struct net_device *dev)
1519{
1520 struct ip6_tnl *t = netdev_priv(dev);
1521
1522 return t->parms.link;
1523}
1524EXPORT_SYMBOL(ip6_tnl_get_iflink);
1520 1525
1521static const struct net_device_ops ip6_tnl_netdev_ops = { 1526static const struct net_device_ops ip6_tnl_netdev_ops = {
1522 .ndo_init = ip6_tnl_dev_init, 1527 .ndo_init = ip6_tnl_dev_init,
@@ -1525,6 +1530,7 @@ static const struct net_device_ops ip6_tnl_netdev_ops = {
1525 .ndo_do_ioctl = ip6_tnl_ioctl, 1530 .ndo_do_ioctl = ip6_tnl_ioctl,
1526 .ndo_change_mtu = ip6_tnl_change_mtu, 1531 .ndo_change_mtu = ip6_tnl_change_mtu,
1527 .ndo_get_stats = ip6_get_stats, 1532 .ndo_get_stats = ip6_get_stats,
1533 .ndo_get_iflink = ip6_tnl_get_iflink,
1528}; 1534};
1529 1535
1530 1536
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
index 53d90ed68905..b53148444e15 100644
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -601,8 +601,6 @@ static void vti6_link_config(struct ip6_tnl *t)
601 dev->flags |= IFF_POINTOPOINT; 601 dev->flags |= IFF_POINTOPOINT;
602 else 602 else
603 dev->flags &= ~IFF_POINTOPOINT; 603 dev->flags &= ~IFF_POINTOPOINT;
604
605 dev->iflink = p->link;
606} 604}
607 605
608/** 606/**
@@ -808,6 +806,7 @@ static const struct net_device_ops vti6_netdev_ops = {
808 .ndo_do_ioctl = vti6_ioctl, 806 .ndo_do_ioctl = vti6_ioctl,
809 .ndo_change_mtu = vti6_change_mtu, 807 .ndo_change_mtu = vti6_change_mtu,
810 .ndo_get_stats64 = ip_tunnel_get_stats64, 808 .ndo_get_stats64 = ip_tunnel_get_stats64,
809 .ndo_get_iflink = ip6_tnl_get_iflink,
811}; 810};
812 811
813/** 812/**