ip6_tunnel.c (1ff05fb7114a6b4118e0f7d89fed2659f7131b0a) ip6_tunnel.c (af31f412c7c7a3c0fda4bf4beaf0c85af1f263c8)
1/*
2 * IPv6 tunneling device
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Ville Nuorvala <vnuorval@tcs.hut.fi>
7 * Yasuyuki Kozakai <kozakai@linux-ipv6.org>
8 *

--- 1336 unchanged lines hidden (view full) ---

1345 ip6_tnl_parm_to_user(&p, &t->parms);
1346 if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof (p))) {
1347 err = -EFAULT;
1348 }
1349 break;
1350 case SIOCADDTUNNEL:
1351 case SIOCCHGTUNNEL:
1352 err = -EPERM;
1/*
2 * IPv6 tunneling device
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Ville Nuorvala <vnuorval@tcs.hut.fi>
7 * Yasuyuki Kozakai <kozakai@linux-ipv6.org>
8 *

--- 1336 unchanged lines hidden (view full) ---

1345 ip6_tnl_parm_to_user(&p, &t->parms);
1346 if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof (p))) {
1347 err = -EFAULT;
1348 }
1349 break;
1350 case SIOCADDTUNNEL:
1351 case SIOCCHGTUNNEL:
1352 err = -EPERM;
1353 if (!capable(CAP_NET_ADMIN))
1353 if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
1354 break;
1355 err = -EFAULT;
1356 if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof (p)))
1357 break;
1358 err = -EINVAL;
1359 if (p.proto != IPPROTO_IPV6 && p.proto != IPPROTO_IPIP &&
1360 p.proto != 0)
1361 break;

--- 16 unchanged lines hidden (view full) ---

1378 if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof(p)))
1379 err = -EFAULT;
1380
1381 } else
1382 err = (cmd == SIOCADDTUNNEL ? -ENOBUFS : -ENOENT);
1383 break;
1384 case SIOCDELTUNNEL:
1385 err = -EPERM;
1354 break;
1355 err = -EFAULT;
1356 if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof (p)))
1357 break;
1358 err = -EINVAL;
1359 if (p.proto != IPPROTO_IPV6 && p.proto != IPPROTO_IPIP &&
1360 p.proto != 0)
1361 break;

--- 16 unchanged lines hidden (view full) ---

1378 if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof(p)))
1379 err = -EFAULT;
1380
1381 } else
1382 err = (cmd == SIOCADDTUNNEL ? -ENOBUFS : -ENOENT);
1383 break;
1384 case SIOCDELTUNNEL:
1385 err = -EPERM;
1386 if (!capable(CAP_NET_ADMIN))
1386 if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
1387 break;
1388
1389 if (dev == ip6n->fb_tnl_dev) {
1390 err = -EFAULT;
1391 if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof (p)))
1392 break;
1393 err = -ENOENT;
1394 ip6_tnl_parm_from_user(&p1, &p);

--- 434 unchanged lines hidden ---
1387 break;
1388
1389 if (dev == ip6n->fb_tnl_dev) {
1390 err = -EFAULT;
1391 if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof (p)))
1392 break;
1393 err = -ENOENT;
1394 ip6_tnl_parm_from_user(&p1, &p);

--- 434 unchanged lines hidden ---