[PATCH 3.17 007/141] gre6: Move the setting of dev->iflink into the ndo_init functions.

Greg Kroah-Hartman
2014-11-19T22:29:58Z

From: Steffen Klassert <steffen.klassert@secunet.com>

[ Upstream commit f03eb128e3f4276f46442d14f3b8f864f3775821 ]

Otherwise it gets overwritten by register_netdev().

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv6/ip6_gre.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -957,8 +957,6 @@ static void ip6gre_tnl_link_config(struc
else
dev->flags &= ~IFF_POINTOPOINT;

- dev->iflink = p->link;
-
/* Precalculate GRE options length */
if (t->parms.o_flags&(GRE_CSUM|GRE_KEY|GRE_SEQ)) {
if (t->parms.o_flags&GRE_CSUM)
@@ -1268,6 +1266,7 @@ static int ip6gre_tunnel_init(struct net
u64_stats_init(&ip6gre_tunnel_stats->syncp);
}

+ dev->iflink = tunnel->parms.link;

return 0;
}
@@ -1477,6 +1476,8 @@ static int ip6gre_tap_init(struct net_de
if (!dev->tstats)
return -ENOMEM;

+ dev->iflink = tunnel->parms.link;
+
return 0;
}