diff options
-rw-r--r-- | net/ipv6/exthdrs_core.c | 2 | ||||
-rw-r--r-- | net/ipv6/icmp.c | 2 | ||||
-rw-r--r-- | net/ipv6/mcast.c | 5 | ||||
-rw-r--r-- | net/ipv6/mip6.c | 6 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 9 | ||||
-rw-r--r-- | net/ipv6/output_core.c | 3 | ||||
-rw-r--r-- | net/ipv6/raw.c | 3 | ||||
-rw-r--r-- | net/ipv6/route.c | 2 |
8 files changed, 19 insertions, 13 deletions
diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c index c5e83fae4df4..140748debc4a 100644 --- a/net/ipv6/exthdrs_core.c +++ b/net/ipv6/exthdrs_core.c | |||
@@ -115,7 +115,7 @@ EXPORT_SYMBOL(ipv6_skip_exthdr); | |||
115 | int ipv6_find_tlv(struct sk_buff *skb, int offset, int type) | 115 | int ipv6_find_tlv(struct sk_buff *skb, int offset, int type) |
116 | { | 116 | { |
117 | const unsigned char *nh = skb_network_header(skb); | 117 | const unsigned char *nh = skb_network_header(skb); |
118 | int packet_len = skb->tail - skb->network_header; | 118 | int packet_len = skb_tail_pointer(skb) - skb_network_header(skb); |
119 | struct ipv6_opt_hdr *hdr; | 119 | struct ipv6_opt_hdr *hdr; |
120 | int len; | 120 | int len; |
121 | 121 | ||
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 1d2902e61786..4b4890bbe16d 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -399,7 +399,7 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info) | |||
399 | int err = 0; | 399 | int err = 0; |
400 | 400 | ||
401 | if ((u8 *)hdr < skb->head || | 401 | if ((u8 *)hdr < skb->head || |
402 | (skb->network_header + sizeof(*hdr)) > skb->tail) | 402 | (skb_network_header(skb) + sizeof(*hdr)) > skb_tail_pointer(skb)) |
403 | return; | 403 | return; |
404 | 404 | ||
405 | /* | 405 | /* |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index bfa6cc36ef2a..72c8bfe06bb4 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -1409,8 +1409,9 @@ static void mld_sendpack(struct sk_buff *skb) | |||
1409 | idev = __in6_dev_get(skb->dev); | 1409 | idev = __in6_dev_get(skb->dev); |
1410 | IP6_UPD_PO_STATS(net, idev, IPSTATS_MIB_OUT, skb->len); | 1410 | IP6_UPD_PO_STATS(net, idev, IPSTATS_MIB_OUT, skb->len); |
1411 | 1411 | ||
1412 | payload_len = (skb->tail - skb->network_header) - sizeof(*pip6); | 1412 | payload_len = (skb_tail_pointer(skb) - skb_network_header(skb)) - |
1413 | mldlen = skb->tail - skb->transport_header; | 1413 | sizeof(*pip6); |
1414 | mldlen = skb_tail_pointer(skb) - skb_transport_header(skb); | ||
1414 | pip6->payload_len = htons(payload_len); | 1415 | pip6->payload_len = htons(payload_len); |
1415 | 1416 | ||
1416 | pmr->mld2r_cksum = csum_ipv6_magic(&pip6->saddr, &pip6->daddr, mldlen, | 1417 | pmr->mld2r_cksum = csum_ipv6_magic(&pip6->saddr, &pip6->daddr, mldlen, |
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c index 0f9bdc5ee9f3..9ac01dc9402e 100644 --- a/net/ipv6/mip6.c +++ b/net/ipv6/mip6.c | |||
@@ -268,7 +268,8 @@ static int mip6_destopt_offset(struct xfrm_state *x, struct sk_buff *skb, | |||
268 | struct ipv6_opt_hdr *exthdr = | 268 | struct ipv6_opt_hdr *exthdr = |
269 | (struct ipv6_opt_hdr *)(ipv6_hdr(skb) + 1); | 269 | (struct ipv6_opt_hdr *)(ipv6_hdr(skb) + 1); |
270 | const unsigned char *nh = skb_network_header(skb); | 270 | const unsigned char *nh = skb_network_header(skb); |
271 | unsigned int packet_len = skb->tail - skb->network_header; | 271 | unsigned int packet_len = skb_tail_pointer(skb) - |
272 | skb_network_header(skb); | ||
272 | int found_rhdr = 0; | 273 | int found_rhdr = 0; |
273 | 274 | ||
274 | *nexthdr = &ipv6_hdr(skb)->nexthdr; | 275 | *nexthdr = &ipv6_hdr(skb)->nexthdr; |
@@ -404,7 +405,8 @@ static int mip6_rthdr_offset(struct xfrm_state *x, struct sk_buff *skb, | |||
404 | struct ipv6_opt_hdr *exthdr = | 405 | struct ipv6_opt_hdr *exthdr = |
405 | (struct ipv6_opt_hdr *)(ipv6_hdr(skb) + 1); | 406 | (struct ipv6_opt_hdr *)(ipv6_hdr(skb) + 1); |
406 | const unsigned char *nh = skb_network_header(skb); | 407 | const unsigned char *nh = skb_network_header(skb); |
407 | unsigned int packet_len = skb->tail - skb->network_header; | 408 | unsigned int packet_len = skb_tail_pointer(skb) - |
409 | skb_network_header(skb); | ||
408 | int found_rhdr = 0; | 410 | int found_rhdr = 0; |
409 | 411 | ||
410 | *nexthdr = &ipv6_hdr(skb)->nexthdr; | 412 | *nexthdr = &ipv6_hdr(skb)->nexthdr; |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index a0962697a257..781dd3c99680 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -693,7 +693,7 @@ static void ndisc_recv_ns(struct sk_buff *skb) | |||
693 | const struct in6_addr *saddr = &ipv6_hdr(skb)->saddr; | 693 | const struct in6_addr *saddr = &ipv6_hdr(skb)->saddr; |
694 | const struct in6_addr *daddr = &ipv6_hdr(skb)->daddr; | 694 | const struct in6_addr *daddr = &ipv6_hdr(skb)->daddr; |
695 | u8 *lladdr = NULL; | 695 | u8 *lladdr = NULL; |
696 | u32 ndoptlen = skb->tail - (skb->transport_header + | 696 | u32 ndoptlen = skb_tail_pointer(skb) - (skb_transport_header(skb) + |
697 | offsetof(struct nd_msg, opt)); | 697 | offsetof(struct nd_msg, opt)); |
698 | struct ndisc_options ndopts; | 698 | struct ndisc_options ndopts; |
699 | struct net_device *dev = skb->dev; | 699 | struct net_device *dev = skb->dev; |
@@ -853,7 +853,7 @@ static void ndisc_recv_na(struct sk_buff *skb) | |||
853 | const struct in6_addr *saddr = &ipv6_hdr(skb)->saddr; | 853 | const struct in6_addr *saddr = &ipv6_hdr(skb)->saddr; |
854 | const struct in6_addr *daddr = &ipv6_hdr(skb)->daddr; | 854 | const struct in6_addr *daddr = &ipv6_hdr(skb)->daddr; |
855 | u8 *lladdr = NULL; | 855 | u8 *lladdr = NULL; |
856 | u32 ndoptlen = skb->tail - (skb->transport_header + | 856 | u32 ndoptlen = skb_tail_pointer(skb) - (skb_transport_header(skb) + |
857 | offsetof(struct nd_msg, opt)); | 857 | offsetof(struct nd_msg, opt)); |
858 | struct ndisc_options ndopts; | 858 | struct ndisc_options ndopts; |
859 | struct net_device *dev = skb->dev; | 859 | struct net_device *dev = skb->dev; |
@@ -1069,7 +1069,8 @@ static void ndisc_router_discovery(struct sk_buff *skb) | |||
1069 | 1069 | ||
1070 | __u8 * opt = (__u8 *)(ra_msg + 1); | 1070 | __u8 * opt = (__u8 *)(ra_msg + 1); |
1071 | 1071 | ||
1072 | optlen = (skb->tail - skb->transport_header) - sizeof(struct ra_msg); | 1072 | optlen = (skb_tail_pointer(skb) - skb_transport_header(skb)) - |
1073 | sizeof(struct ra_msg); | ||
1073 | 1074 | ||
1074 | if (!(ipv6_addr_type(&ipv6_hdr(skb)->saddr) & IPV6_ADDR_LINKLOCAL)) { | 1075 | if (!(ipv6_addr_type(&ipv6_hdr(skb)->saddr) & IPV6_ADDR_LINKLOCAL)) { |
1075 | ND_PRINTK(2, warn, "RA: source address is not link-local\n"); | 1076 | ND_PRINTK(2, warn, "RA: source address is not link-local\n"); |
@@ -1346,7 +1347,7 @@ static void ndisc_redirect_rcv(struct sk_buff *skb) | |||
1346 | u8 *hdr; | 1347 | u8 *hdr; |
1347 | struct ndisc_options ndopts; | 1348 | struct ndisc_options ndopts; |
1348 | struct rd_msg *msg = (struct rd_msg *)skb_transport_header(skb); | 1349 | struct rd_msg *msg = (struct rd_msg *)skb_transport_header(skb); |
1349 | u32 ndoptlen = skb->tail - (skb->transport_header + | 1350 | u32 ndoptlen = skb_tail_pointer(skb) - (skb_transport_header(skb) + |
1350 | offsetof(struct rd_msg, opt)); | 1351 | offsetof(struct rd_msg, opt)); |
1351 | 1352 | ||
1352 | #ifdef CONFIG_IPV6_NDISC_NODETYPE | 1353 | #ifdef CONFIG_IPV6_NDISC_NODETYPE |
diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c index c2e73e647e44..ab92a3673fbb 100644 --- a/net/ipv6/output_core.c +++ b/net/ipv6/output_core.c | |||
@@ -40,7 +40,8 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr) | |||
40 | u16 offset = sizeof(struct ipv6hdr); | 40 | u16 offset = sizeof(struct ipv6hdr); |
41 | struct ipv6_opt_hdr *exthdr = | 41 | struct ipv6_opt_hdr *exthdr = |
42 | (struct ipv6_opt_hdr *)(ipv6_hdr(skb) + 1); | 42 | (struct ipv6_opt_hdr *)(ipv6_hdr(skb) + 1); |
43 | unsigned int packet_len = skb->tail - skb->network_header; | 43 | unsigned int packet_len = skb_tail_pointer(skb) - |
44 | skb_network_header(skb); | ||
44 | int found_rhdr = 0; | 45 | int found_rhdr = 0; |
45 | *nexthdr = &ipv6_hdr(skb)->nexthdr; | 46 | *nexthdr = &ipv6_hdr(skb)->nexthdr; |
46 | 47 | ||
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index eedff8ccded5..4f8886aa8429 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -1132,7 +1132,8 @@ static int rawv6_ioctl(struct sock *sk, int cmd, unsigned long arg) | |||
1132 | spin_lock_bh(&sk->sk_receive_queue.lock); | 1132 | spin_lock_bh(&sk->sk_receive_queue.lock); |
1133 | skb = skb_peek(&sk->sk_receive_queue); | 1133 | skb = skb_peek(&sk->sk_receive_queue); |
1134 | if (skb != NULL) | 1134 | if (skb != NULL) |
1135 | amount = skb->tail - skb->transport_header; | 1135 | amount = skb_tail_pointer(skb) - |
1136 | skb_transport_header(skb); | ||
1136 | spin_unlock_bh(&sk->sk_receive_queue.lock); | 1137 | spin_unlock_bh(&sk->sk_receive_queue.lock); |
1137 | return put_user(amount, (int __user *)arg); | 1138 | return put_user(amount, (int __user *)arg); |
1138 | } | 1139 | } |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 194c3cde1536..2b874185ebb2 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -1649,7 +1649,7 @@ static void rt6_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_bu | |||
1649 | int optlen, on_link; | 1649 | int optlen, on_link; |
1650 | u8 *lladdr; | 1650 | u8 *lladdr; |
1651 | 1651 | ||
1652 | optlen = skb->tail - skb->transport_header; | 1652 | optlen = skb_tail_pointer(skb) - skb_transport_header(skb); |
1653 | optlen -= sizeof(*msg); | 1653 | optlen -= sizeof(*msg); |
1654 | 1654 | ||
1655 | if (optlen < 0) { | 1655 | if (optlen < 0) { |