diff options
Diffstat (limited to 'net/ipv6/ip6_tunnel.c')
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 69a84b464009..9409887fb664 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -412,12 +412,12 @@ __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw) | |||
412 | { | 412 | { |
413 | const struct ipv6hdr *ipv6h = (const struct ipv6hdr *) raw; | 413 | const struct ipv6hdr *ipv6h = (const struct ipv6hdr *) raw; |
414 | __u8 nexthdr = ipv6h->nexthdr; | 414 | __u8 nexthdr = ipv6h->nexthdr; |
415 | __u16 off = sizeof (*ipv6h); | 415 | __u16 off = sizeof(*ipv6h); |
416 | 416 | ||
417 | while (ipv6_ext_hdr(nexthdr) && nexthdr != NEXTHDR_NONE) { | 417 | while (ipv6_ext_hdr(nexthdr) && nexthdr != NEXTHDR_NONE) { |
418 | __u16 optlen = 0; | 418 | __u16 optlen = 0; |
419 | struct ipv6_opt_hdr *hdr; | 419 | struct ipv6_opt_hdr *hdr; |
420 | if (raw + off + sizeof (*hdr) > skb->data && | 420 | if (raw + off + sizeof(*hdr) > skb->data && |
421 | !pskb_may_pull(skb, raw - skb->data + off + sizeof (*hdr))) | 421 | !pskb_may_pull(skb, raw - skb->data + off + sizeof (*hdr))) |
422 | break; | 422 | break; |
423 | 423 | ||
@@ -534,7 +534,7 @@ ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt, | |||
534 | mtu = IPV6_MIN_MTU; | 534 | mtu = IPV6_MIN_MTU; |
535 | t->dev->mtu = mtu; | 535 | t->dev->mtu = mtu; |
536 | 536 | ||
537 | if ((len = sizeof (*ipv6h) + ntohs(ipv6h->payload_len)) > mtu) { | 537 | if ((len = sizeof(*ipv6h) + ntohs(ipv6h->payload_len)) > mtu) { |
538 | rel_type = ICMPV6_PKT_TOOBIG; | 538 | rel_type = ICMPV6_PKT_TOOBIG; |
539 | rel_code = 0; | 539 | rel_code = 0; |
540 | rel_info = mtu; | 540 | rel_info = mtu; |
@@ -995,7 +995,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb, | |||
995 | t->parms.name); | 995 | t->parms.name); |
996 | goto tx_err_dst_release; | 996 | goto tx_err_dst_release; |
997 | } | 997 | } |
998 | mtu = dst_mtu(dst) - sizeof (*ipv6h); | 998 | mtu = dst_mtu(dst) - sizeof(*ipv6h); |
999 | if (encap_limit >= 0) { | 999 | if (encap_limit >= 0) { |
1000 | max_headroom += 8; | 1000 | max_headroom += 8; |
1001 | mtu -= 8; | 1001 | mtu -= 8; |
@@ -1087,7 +1087,7 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1087 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) | 1087 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) |
1088 | encap_limit = t->parms.encap_limit; | 1088 | encap_limit = t->parms.encap_limit; |
1089 | 1089 | ||
1090 | memcpy(&fl6, &t->fl.u.ip6, sizeof (fl6)); | 1090 | memcpy(&fl6, &t->fl.u.ip6, sizeof(fl6)); |
1091 | fl6.flowi6_proto = IPPROTO_IPIP; | 1091 | fl6.flowi6_proto = IPPROTO_IPIP; |
1092 | 1092 | ||
1093 | dsfield = ipv4_get_dsfield(iph); | 1093 | dsfield = ipv4_get_dsfield(iph); |
@@ -1139,7 +1139,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1139 | } else if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) | 1139 | } else if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) |
1140 | encap_limit = t->parms.encap_limit; | 1140 | encap_limit = t->parms.encap_limit; |
1141 | 1141 | ||
1142 | memcpy(&fl6, &t->fl.u.ip6, sizeof (fl6)); | 1142 | memcpy(&fl6, &t->fl.u.ip6, sizeof(fl6)); |
1143 | fl6.flowi6_proto = IPPROTO_IPV6; | 1143 | fl6.flowi6_proto = IPPROTO_IPV6; |
1144 | 1144 | ||
1145 | dsfield = ipv6_get_dsfield(ipv6h); | 1145 | dsfield = ipv6_get_dsfield(ipv6h); |
@@ -1233,11 +1233,11 @@ static void ip6_tnl_link_config(struct ip6_tnl *t) | |||
1233 | 1233 | ||
1234 | if (rt->dst.dev) { | 1234 | if (rt->dst.dev) { |
1235 | dev->hard_header_len = rt->dst.dev->hard_header_len + | 1235 | dev->hard_header_len = rt->dst.dev->hard_header_len + |
1236 | sizeof (struct ipv6hdr); | 1236 | sizeof(struct ipv6hdr); |
1237 | 1237 | ||
1238 | dev->mtu = rt->dst.dev->mtu - sizeof (struct ipv6hdr); | 1238 | dev->mtu = rt->dst.dev->mtu - sizeof(struct ipv6hdr); |
1239 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) | 1239 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) |
1240 | dev->mtu-=8; | 1240 | dev->mtu -= 8; |
1241 | 1241 | ||
1242 | if (dev->mtu < IPV6_MIN_MTU) | 1242 | if (dev->mtu < IPV6_MIN_MTU) |
1243 | dev->mtu = IPV6_MIN_MTU; | 1243 | dev->mtu = IPV6_MIN_MTU; |
@@ -1354,7 +1354,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1354 | switch (cmd) { | 1354 | switch (cmd) { |
1355 | case SIOCGETTUNNEL: | 1355 | case SIOCGETTUNNEL: |
1356 | if (dev == ip6n->fb_tnl_dev) { | 1356 | if (dev == ip6n->fb_tnl_dev) { |
1357 | if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof (p))) { | 1357 | if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p))) { |
1358 | err = -EFAULT; | 1358 | err = -EFAULT; |
1359 | break; | 1359 | break; |
1360 | } | 1360 | } |
@@ -1366,7 +1366,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1366 | memset(&p, 0, sizeof(p)); | 1366 | memset(&p, 0, sizeof(p)); |
1367 | } | 1367 | } |
1368 | ip6_tnl_parm_to_user(&p, &t->parms); | 1368 | ip6_tnl_parm_to_user(&p, &t->parms); |
1369 | if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof (p))) { | 1369 | if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof(p))) { |
1370 | err = -EFAULT; | 1370 | err = -EFAULT; |
1371 | } | 1371 | } |
1372 | break; | 1372 | break; |
@@ -1376,7 +1376,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1376 | if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) | 1376 | if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) |
1377 | break; | 1377 | break; |
1378 | err = -EFAULT; | 1378 | err = -EFAULT; |
1379 | if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof (p))) | 1379 | if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p))) |
1380 | break; | 1380 | break; |
1381 | err = -EINVAL; | 1381 | err = -EINVAL; |
1382 | if (p.proto != IPPROTO_IPV6 && p.proto != IPPROTO_IPIP && | 1382 | if (p.proto != IPPROTO_IPV6 && p.proto != IPPROTO_IPIP && |
@@ -1411,7 +1411,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1411 | 1411 | ||
1412 | if (dev == ip6n->fb_tnl_dev) { | 1412 | if (dev == ip6n->fb_tnl_dev) { |
1413 | err = -EFAULT; | 1413 | err = -EFAULT; |
1414 | if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof (p))) | 1414 | if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p))) |
1415 | break; | 1415 | break; |
1416 | err = -ENOENT; | 1416 | err = -ENOENT; |
1417 | ip6_tnl_parm_from_user(&p1, &p); | 1417 | ip6_tnl_parm_from_user(&p1, &p); |
@@ -1486,14 +1486,14 @@ static void ip6_tnl_dev_setup(struct net_device *dev) | |||
1486 | dev->destructor = ip6_dev_free; | 1486 | dev->destructor = ip6_dev_free; |
1487 | 1487 | ||
1488 | dev->type = ARPHRD_TUNNEL6; | 1488 | dev->type = ARPHRD_TUNNEL6; |
1489 | dev->hard_header_len = LL_MAX_HEADER + sizeof (struct ipv6hdr); | 1489 | dev->hard_header_len = LL_MAX_HEADER + sizeof(struct ipv6hdr); |
1490 | dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr); | 1490 | dev->mtu = ETH_DATA_LEN - sizeof(struct ipv6hdr); |
1491 | t = netdev_priv(dev); | 1491 | t = netdev_priv(dev); |
1492 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) | 1492 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) |
1493 | dev->mtu-=8; | 1493 | dev->mtu -= 8; |
1494 | dev->flags |= IFF_NOARP; | 1494 | dev->flags |= IFF_NOARP; |
1495 | dev->addr_len = sizeof(struct in6_addr); | 1495 | dev->addr_len = sizeof(struct in6_addr); |
1496 | dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; | 1496 | netif_keep_dst(dev); |
1497 | /* This perm addr will be used as interface identifier by IPv6 */ | 1497 | /* This perm addr will be used as interface identifier by IPv6 */ |
1498 | dev->addr_assign_type = NET_ADDR_RANDOM; | 1498 | dev->addr_assign_type = NET_ADDR_RANDOM; |
1499 | eth_random_addr(dev->perm_addr); | 1499 | eth_random_addr(dev->perm_addr); |