aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/icmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/icmp.c')
-rw-r--r--net/ipv6/icmp.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 9b7d19ae5ced..4f433847d95f 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -233,7 +233,7 @@ static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct
233 icmp6h->icmp6_cksum = 0; 233 icmp6h->icmp6_cksum = 0;
234 234
235 if (skb_queue_len(&sk->sk_write_queue) == 1) { 235 if (skb_queue_len(&sk->sk_write_queue) == 1) {
236 skb->csum = csum_partial((char *)icmp6h, 236 skb->csum = csum_partial(icmp6h,
237 sizeof(struct icmp6hdr), skb->csum); 237 sizeof(struct icmp6hdr), skb->csum);
238 icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src, 238 icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src,
239 &fl->fl6_dst, 239 &fl->fl6_dst,
@@ -246,7 +246,7 @@ static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct
246 tmp_csum = csum_add(tmp_csum, skb->csum); 246 tmp_csum = csum_add(tmp_csum, skb->csum);
247 } 247 }
248 248
249 tmp_csum = csum_partial((char *)icmp6h, 249 tmp_csum = csum_partial(icmp6h,
250 sizeof(struct icmp6hdr), tmp_csum); 250 sizeof(struct icmp6hdr), tmp_csum);
251 icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src, 251 icmp6h->icmp6_cksum = csum_ipv6_magic(&fl->fl6_src,
252 &fl->fl6_dst, 252 &fl->fl6_dst,
@@ -427,7 +427,7 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
427 /* No need to clone since we're just using its address. */ 427 /* No need to clone since we're just using its address. */
428 dst2 = dst; 428 dst2 = dst;
429 429
430 err = xfrm_lookup(&dst, &fl, sk, 0); 430 err = xfrm_lookup(net, &dst, &fl, sk, 0);
431 switch (err) { 431 switch (err) {
432 case 0: 432 case 0:
433 if (dst != dst2) 433 if (dst != dst2)
@@ -446,7 +446,7 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
446 if (ip6_dst_lookup(sk, &dst2, &fl)) 446 if (ip6_dst_lookup(sk, &dst2, &fl))
447 goto relookup_failed; 447 goto relookup_failed;
448 448
449 err = xfrm_lookup(&dst2, &fl, sk, XFRM_LOOKUP_ICMP); 449 err = xfrm_lookup(net, &dst2, &fl, sk, XFRM_LOOKUP_ICMP);
450 switch (err) { 450 switch (err) {
451 case 0: 451 case 0:
452 dst_release(dst); 452 dst_release(dst);
@@ -552,7 +552,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
552 err = ip6_dst_lookup(sk, &dst, &fl); 552 err = ip6_dst_lookup(sk, &dst, &fl);
553 if (err) 553 if (err)
554 goto out; 554 goto out;
555 if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) 555 if ((err = xfrm_lookup(net, &dst, &fl, sk, 0)) < 0)
556 goto out; 556 goto out;
557 557
558 if (ipv6_addr_is_multicast(&fl.fl6_dst)) 558 if (ipv6_addr_is_multicast(&fl.fl6_dst))
@@ -646,9 +646,10 @@ static int icmpv6_rcv(struct sk_buff *skb)
646 int type; 646 int type;
647 647
648 if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) { 648 if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
649 struct sec_path *sp = skb_sec_path(skb);
649 int nh; 650 int nh;
650 651
651 if (!(skb->sp && skb->sp->xvec[skb->sp->len - 1]->props.flags & 652 if (!(sp && sp->xvec[sp->len - 1]->props.flags &
652 XFRM_STATE_ICMP)) 653 XFRM_STATE_ICMP))
653 goto drop_no_count; 654 goto drop_no_count;
654 655
@@ -680,8 +681,8 @@ static int icmpv6_rcv(struct sk_buff *skb)
680 skb->csum = ~csum_unfold(csum_ipv6_magic(saddr, daddr, skb->len, 681 skb->csum = ~csum_unfold(csum_ipv6_magic(saddr, daddr, skb->len,
681 IPPROTO_ICMPV6, 0)); 682 IPPROTO_ICMPV6, 0));
682 if (__skb_checksum_complete(skb)) { 683 if (__skb_checksum_complete(skb)) {
683 LIMIT_NETDEBUG(KERN_DEBUG "ICMPv6 checksum failed [" NIP6_FMT " > " NIP6_FMT "]\n", 684 LIMIT_NETDEBUG(KERN_DEBUG "ICMPv6 checksum failed [%pI6 > %pI6]\n",
684 NIP6(*saddr), NIP6(*daddr)); 685 saddr, daddr);
685 goto discard_it; 686 goto discard_it;
686 } 687 }
687 } 688 }
@@ -955,8 +956,8 @@ ctl_table ipv6_icmp_table_template[] = {
955 .data = &init_net.ipv6.sysctl.icmpv6_time, 956 .data = &init_net.ipv6.sysctl.icmpv6_time,
956 .maxlen = sizeof(int), 957 .maxlen = sizeof(int),
957 .mode = 0644, 958 .mode = 0644,
958 .proc_handler = &proc_dointvec_ms_jiffies, 959 .proc_handler = proc_dointvec_ms_jiffies,
959 .strategy = &sysctl_ms_jiffies 960 .strategy = sysctl_ms_jiffies
960 }, 961 },
961 { .ctl_name = 0 }, 962 { .ctl_name = 0 },
962}; 963};