diff options
Diffstat (limited to 'net/ipv6/ip6_tunnel.c')
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index e1df691d78be..f6a66bb4114d 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -1340,8 +1340,8 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1340 | int err = 0; | 1340 | int err = 0; |
1341 | struct ip6_tnl_parm p; | 1341 | struct ip6_tnl_parm p; |
1342 | struct __ip6_tnl_parm p1; | 1342 | struct __ip6_tnl_parm p1; |
1343 | struct ip6_tnl *t = NULL; | 1343 | struct ip6_tnl *t = netdev_priv(dev); |
1344 | struct net *net = dev_net(dev); | 1344 | struct net *net = t->net; |
1345 | struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); | 1345 | struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); |
1346 | 1346 | ||
1347 | switch (cmd) { | 1347 | switch (cmd) { |
@@ -1353,11 +1353,11 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1353 | } | 1353 | } |
1354 | ip6_tnl_parm_from_user(&p1, &p); | 1354 | ip6_tnl_parm_from_user(&p1, &p); |
1355 | t = ip6_tnl_locate(net, &p1, 0); | 1355 | t = ip6_tnl_locate(net, &p1, 0); |
1356 | if (t == NULL) | ||
1357 | t = netdev_priv(dev); | ||
1356 | } else { | 1358 | } else { |
1357 | memset(&p, 0, sizeof(p)); | 1359 | memset(&p, 0, sizeof(p)); |
1358 | } | 1360 | } |
1359 | if (t == NULL) | ||
1360 | t = netdev_priv(dev); | ||
1361 | ip6_tnl_parm_to_user(&p, &t->parms); | 1361 | ip6_tnl_parm_to_user(&p, &t->parms); |
1362 | if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof (p))) { | 1362 | if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof (p))) { |
1363 | err = -EFAULT; | 1363 | err = -EFAULT; |
@@ -1557,7 +1557,7 @@ static int ip6_tnl_validate(struct nlattr *tb[], struct nlattr *data[]) | |||
1557 | { | 1557 | { |
1558 | u8 proto; | 1558 | u8 proto; |
1559 | 1559 | ||
1560 | if (!data) | 1560 | if (!data || !data[IFLA_IPTUN_PROTO]) |
1561 | return 0; | 1561 | return 0; |
1562 | 1562 | ||
1563 | proto = nla_get_u8(data[IFLA_IPTUN_PROTO]); | 1563 | proto = nla_get_u8(data[IFLA_IPTUN_PROTO]); |