Commit e0c93948 authored by YOSHIFUJI Hideaki / 吉藤英明's avatar YOSHIFUJI Hideaki / 吉藤英明 Committed by David S. Miller

ipv6 sit: Ensure to initialize 6rd parameters.

ipv6 sit: Ensure to initialize 6rd parameters.
Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 71034ba8
...@@ -161,9 +161,11 @@ static void ipip6_tunnel_link(struct sit_net *sitn, struct ip_tunnel *t) ...@@ -161,9 +161,11 @@ static void ipip6_tunnel_link(struct sit_net *sitn, struct ip_tunnel *t)
write_unlock_bh(&ipip6_lock); write_unlock_bh(&ipip6_lock);
} }
static void ipip6_tunnel_clone_6rd(struct ip_tunnel *t, struct sit_net *sitn) static void ipip6_tunnel_clone_6rd(struct net_device *dev, struct sit_net *sitn)
{ {
#ifdef CONFIG_IPV6_SIT_6RD #ifdef CONFIG_IPV6_SIT_6RD
struct ip_tunnel *t = netdev_priv(dev);
if (t->dev == sitn->fb_tunnel_dev) { if (t->dev == sitn->fb_tunnel_dev) {
ipv6_addr_set(&t->ip6rd.prefix, htonl(0x20020000), 0, 0, 0); ipv6_addr_set(&t->ip6rd.prefix, htonl(0x20020000), 0, 0, 0);
t->ip6rd.relay_prefix = 0; t->ip6rd.relay_prefix = 0;
...@@ -219,6 +221,7 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct net *net, ...@@ -219,6 +221,7 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct net *net,
nt->parms = *parms; nt->parms = *parms;
ipip6_tunnel_init(dev); ipip6_tunnel_init(dev);
ipip6_tunnel_clone_6rd(dev, sitn);
if (parms->i_flags & SIT_ISATAP) if (parms->i_flags & SIT_ISATAP)
dev->priv_flags |= IFF_ISATAP; dev->priv_flags |= IFF_ISATAP;
...@@ -228,8 +231,6 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct net *net, ...@@ -228,8 +231,6 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct net *net,
dev_hold(dev); dev_hold(dev);
ipip6_tunnel_clone_6rd(t, sitn);
ipip6_tunnel_link(sitn, nt); ipip6_tunnel_link(sitn, nt);
return nt; return nt;
...@@ -1024,7 +1025,7 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -1024,7 +1025,7 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
t->ip6rd.prefixlen = ip6rd.prefixlen; t->ip6rd.prefixlen = ip6rd.prefixlen;
t->ip6rd.relay_prefixlen = ip6rd.relay_prefixlen; t->ip6rd.relay_prefixlen = ip6rd.relay_prefixlen;
} else } else
ipip6_tunnel_clone_6rd(t, sitn); ipip6_tunnel_clone_6rd(dev, sitn);
err = 0; err = 0;
break; break;
...@@ -1148,6 +1149,7 @@ static int sit_init_net(struct net *net) ...@@ -1148,6 +1149,7 @@ static int sit_init_net(struct net *net)
dev_net_set(sitn->fb_tunnel_dev, net); dev_net_set(sitn->fb_tunnel_dev, net);
ipip6_fb_tunnel_init(sitn->fb_tunnel_dev); ipip6_fb_tunnel_init(sitn->fb_tunnel_dev);
ipip6_tunnel_clone_6rd(sitn->fb_tunnel_dev, sitn);
if ((err = register_netdev(sitn->fb_tunnel_dev))) if ((err = register_netdev(sitn->fb_tunnel_dev)))
goto err_reg_dev; goto err_reg_dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment