diff options
Diffstat (limited to 'net/ipv6/icmp.c')
-rw-r--r-- | net/ipv6/icmp.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 90868fb42757..01d46bff63c3 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -135,11 +135,12 @@ static int is_ineligible(struct sk_buff *skb) | |||
135 | int ptr = (u8 *)(ipv6_hdr(skb) + 1) - skb->data; | 135 | int ptr = (u8 *)(ipv6_hdr(skb) + 1) - skb->data; |
136 | int len = skb->len - ptr; | 136 | int len = skb->len - ptr; |
137 | __u8 nexthdr = ipv6_hdr(skb)->nexthdr; | 137 | __u8 nexthdr = ipv6_hdr(skb)->nexthdr; |
138 | __be16 frag_off; | ||
138 | 139 | ||
139 | if (len < 0) | 140 | if (len < 0) |
140 | return 1; | 141 | return 1; |
141 | 142 | ||
142 | ptr = ipv6_skip_exthdr(skb, ptr, &nexthdr); | 143 | ptr = ipv6_skip_exthdr(skb, ptr, &nexthdr, &frag_off); |
143 | if (ptr < 0) | 144 | if (ptr < 0) |
144 | return 0; | 145 | return 0; |
145 | if (nexthdr == IPPROTO_ICMPV6) { | 146 | if (nexthdr == IPPROTO_ICMPV6) { |
@@ -290,9 +291,9 @@ static void mip6_addr_swap(struct sk_buff *skb) | |||
290 | if (likely(off >= 0)) { | 291 | if (likely(off >= 0)) { |
291 | hao = (struct ipv6_destopt_hao *) | 292 | hao = (struct ipv6_destopt_hao *) |
292 | (skb_network_header(skb) + off); | 293 | (skb_network_header(skb) + off); |
293 | ipv6_addr_copy(&tmp, &iph->saddr); | 294 | tmp = iph->saddr; |
294 | ipv6_addr_copy(&iph->saddr, &hao->addr); | 295 | iph->saddr = hao->addr; |
295 | ipv6_addr_copy(&hao->addr, &tmp); | 296 | hao->addr = tmp; |
296 | } | 297 | } |
297 | } | 298 | } |
298 | } | 299 | } |
@@ -444,9 +445,9 @@ void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info) | |||
444 | 445 | ||
445 | memset(&fl6, 0, sizeof(fl6)); | 446 | memset(&fl6, 0, sizeof(fl6)); |
446 | fl6.flowi6_proto = IPPROTO_ICMPV6; | 447 | fl6.flowi6_proto = IPPROTO_ICMPV6; |
447 | ipv6_addr_copy(&fl6.daddr, &hdr->saddr); | 448 | fl6.daddr = hdr->saddr; |
448 | if (saddr) | 449 | if (saddr) |
449 | ipv6_addr_copy(&fl6.saddr, saddr); | 450 | fl6.saddr = *saddr; |
450 | fl6.flowi6_oif = iif; | 451 | fl6.flowi6_oif = iif; |
451 | fl6.fl6_icmp_type = type; | 452 | fl6.fl6_icmp_type = type; |
452 | fl6.fl6_icmp_code = code; | 453 | fl6.fl6_icmp_code = code; |
@@ -538,9 +539,9 @@ static void icmpv6_echo_reply(struct sk_buff *skb) | |||
538 | 539 | ||
539 | memset(&fl6, 0, sizeof(fl6)); | 540 | memset(&fl6, 0, sizeof(fl6)); |
540 | fl6.flowi6_proto = IPPROTO_ICMPV6; | 541 | fl6.flowi6_proto = IPPROTO_ICMPV6; |
541 | ipv6_addr_copy(&fl6.daddr, &ipv6_hdr(skb)->saddr); | 542 | fl6.daddr = ipv6_hdr(skb)->saddr; |
542 | if (saddr) | 543 | if (saddr) |
543 | ipv6_addr_copy(&fl6.saddr, saddr); | 544 | fl6.saddr = *saddr; |
544 | fl6.flowi6_oif = skb->dev->ifindex; | 545 | fl6.flowi6_oif = skb->dev->ifindex; |
545 | fl6.fl6_icmp_type = ICMPV6_ECHO_REPLY; | 546 | fl6.fl6_icmp_type = ICMPV6_ECHO_REPLY; |
546 | security_skb_classify_flow(skb, flowi6_to_flowi(&fl6)); | 547 | security_skb_classify_flow(skb, flowi6_to_flowi(&fl6)); |
@@ -596,6 +597,7 @@ static void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info) | |||
596 | int inner_offset; | 597 | int inner_offset; |
597 | int hash; | 598 | int hash; |
598 | u8 nexthdr; | 599 | u8 nexthdr; |
600 | __be16 frag_off; | ||
599 | 601 | ||
600 | if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) | 602 | if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) |
601 | return; | 603 | return; |
@@ -603,7 +605,8 @@ static void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info) | |||
603 | nexthdr = ((struct ipv6hdr *)skb->data)->nexthdr; | 605 | nexthdr = ((struct ipv6hdr *)skb->data)->nexthdr; |
604 | if (ipv6_ext_hdr(nexthdr)) { | 606 | if (ipv6_ext_hdr(nexthdr)) { |
605 | /* now skip over extension headers */ | 607 | /* now skip over extension headers */ |
606 | inner_offset = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr); | 608 | inner_offset = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), |
609 | &nexthdr, &frag_off); | ||
607 | if (inner_offset<0) | 610 | if (inner_offset<0) |
608 | return; | 611 | return; |
609 | } else { | 612 | } else { |
@@ -786,8 +789,8 @@ void icmpv6_flow_init(struct sock *sk, struct flowi6 *fl6, | |||
786 | int oif) | 789 | int oif) |
787 | { | 790 | { |
788 | memset(fl6, 0, sizeof(*fl6)); | 791 | memset(fl6, 0, sizeof(*fl6)); |
789 | ipv6_addr_copy(&fl6->saddr, saddr); | 792 | fl6->saddr = *saddr; |
790 | ipv6_addr_copy(&fl6->daddr, daddr); | 793 | fl6->daddr = *daddr; |
791 | fl6->flowi6_proto = IPPROTO_ICMPV6; | 794 | fl6->flowi6_proto = IPPROTO_ICMPV6; |
792 | fl6->fl6_icmp_type = type; | 795 | fl6->fl6_icmp_type = type; |
793 | fl6->fl6_icmp_code = 0; | 796 | fl6->fl6_icmp_code = 0; |