@@ -161,9 +161,11 @@ static void ipip6_tunnel_link(struct sit_net *sitn, struct ip_tunnel *t)
161
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
166
#ifdef CONFIG_IPV6_SIT_6RD
167
+ struct ip_tunnel * t = netdev_priv (dev );
168
+
167
169
if (t -> dev == sitn -> fb_tunnel_dev ) {
168
170
ipv6_addr_set (& t -> ip6rd .prefix , htonl (0x20020000 ), 0 , 0 , 0 );
169
171
t -> ip6rd .relay_prefix = 0 ;
@@ -219,6 +221,7 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct net *net,
219
221
220
222
nt -> parms = * parms ;
221
223
ipip6_tunnel_init (dev );
224
+ ipip6_tunnel_clone_6rd (dev , sitn );
222
225
223
226
if (parms -> i_flags & SIT_ISATAP )
224
227
dev -> priv_flags |= IFF_ISATAP ;
@@ -228,8 +231,6 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct net *net,
228
231
229
232
dev_hold (dev );
230
233
231
- ipip6_tunnel_clone_6rd (t , sitn );
232
-
233
234
ipip6_tunnel_link (sitn , nt );
234
235
return nt ;
235
236
@@ -1024,7 +1025,7 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
1024
1025
t -> ip6rd .prefixlen = ip6rd .prefixlen ;
1025
1026
t -> ip6rd .relay_prefixlen = ip6rd .relay_prefixlen ;
1026
1027
} else
1027
- ipip6_tunnel_clone_6rd (t , sitn );
1028
+ ipip6_tunnel_clone_6rd (dev , sitn );
1028
1029
1029
1030
err = 0 ;
1030
1031
break ;
@@ -1148,6 +1149,7 @@ static int sit_init_net(struct net *net)
1148
1149
dev_net_set (sitn -> fb_tunnel_dev , net );
1149
1150
1150
1151
ipip6_fb_tunnel_init (sitn -> fb_tunnel_dev );
1152
+ ipip6_tunnel_clone_6rd (sitn -> fb_tunnel_dev , sitn );
1151
1153
1152
1154
if ((err = register_netdev (sitn -> fb_tunnel_dev )))
1153
1155
goto err_reg_dev ;
0 commit comments