diff options
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 6955654262a5..8594451c747b 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -161,9 +161,11 @@ static void ipip6_tunnel_link(struct sit_net *sitn, struct ip_tunnel *t) | |||
161 | write_unlock_bh(&ipip6_lock); | 161 | write_unlock_bh(&ipip6_lock); |
162 | } | 162 | } |
163 | 163 | ||
164 | static void ipip6_tunnel_clone_6rd(struct ip_tunnel *t, struct sit_net *sitn) | 164 | static void ipip6_tunnel_clone_6rd(struct net_device *dev, struct sit_net *sitn) |
165 | { | 165 | { |
166 | #ifdef CONFIG_IPV6_SIT_6RD | 166 | #ifdef CONFIG_IPV6_SIT_6RD |
167 | struct ip_tunnel *t = netdev_priv(dev); | ||
168 | |||
167 | if (t->dev == sitn->fb_tunnel_dev) { | 169 | if (t->dev == sitn->fb_tunnel_dev) { |
168 | ipv6_addr_set(&t->ip6rd.prefix, htonl(0x20020000), 0, 0, 0); | 170 | ipv6_addr_set(&t->ip6rd.prefix, htonl(0x20020000), 0, 0, 0); |
169 | t->ip6rd.relay_prefix = 0; | 171 | t->ip6rd.relay_prefix = 0; |
@@ -219,6 +221,7 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct net *net, | |||
219 | 221 | ||
220 | nt->parms = *parms; | 222 | nt->parms = *parms; |
221 | ipip6_tunnel_init(dev); | 223 | ipip6_tunnel_init(dev); |
224 | ipip6_tunnel_clone_6rd(dev, sitn); | ||
222 | 225 | ||
223 | if (parms->i_flags & SIT_ISATAP) | 226 | if (parms->i_flags & SIT_ISATAP) |
224 | dev->priv_flags |= IFF_ISATAP; | 227 | dev->priv_flags |= IFF_ISATAP; |
@@ -228,8 +231,6 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct net *net, | |||
228 | 231 | ||
229 | dev_hold(dev); | 232 | dev_hold(dev); |
230 | 233 | ||
231 | ipip6_tunnel_clone_6rd(t, sitn); | ||
232 | |||
233 | ipip6_tunnel_link(sitn, nt); | 234 | ipip6_tunnel_link(sitn, nt); |
234 | return nt; | 235 | return nt; |
235 | 236 | ||
@@ -1024,7 +1025,7 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1024 | t->ip6rd.prefixlen = ip6rd.prefixlen; | 1025 | t->ip6rd.prefixlen = ip6rd.prefixlen; |
1025 | t->ip6rd.relay_prefixlen = ip6rd.relay_prefixlen; | 1026 | t->ip6rd.relay_prefixlen = ip6rd.relay_prefixlen; |
1026 | } else | 1027 | } else |
1027 | ipip6_tunnel_clone_6rd(t, sitn); | 1028 | ipip6_tunnel_clone_6rd(dev, sitn); |
1028 | 1029 | ||
1029 | err = 0; | 1030 | err = 0; |
1030 | break; | 1031 | break; |
@@ -1148,6 +1149,7 @@ static int sit_init_net(struct net *net) | |||
1148 | dev_net_set(sitn->fb_tunnel_dev, net); | 1149 | dev_net_set(sitn->fb_tunnel_dev, net); |
1149 | 1150 | ||
1150 | ipip6_fb_tunnel_init(sitn->fb_tunnel_dev); | 1151 | ipip6_fb_tunnel_init(sitn->fb_tunnel_dev); |
1152 | ipip6_tunnel_clone_6rd(sitn->fb_tunnel_dev, sitn); | ||
1151 | 1153 | ||
1152 | if ((err = register_netdev(sitn->fb_tunnel_dev))) | 1154 | if ((err = register_netdev(sitn->fb_tunnel_dev))) |
1153 | goto err_reg_dev; | 1155 | goto err_reg_dev; |