]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[IPv6]: Only modify checksum for UDP
authorBrian Haley <brian.haley@hp.com>
Fri, 10 Nov 2006 22:54:51 +0000 (14:54 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 3 Dec 2006 05:22:13 +0000 (21:22 -0800)
Only change upper-layer checksum from 0 to 0xFFFF for UDP (as RFC 768
states), not for others as RFC 4443 doesn't require it.

Signed-off-by: Brian Haley <brian.haley@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/icmp.c
net/ipv6/raw.c

index 52cca93ff2f82fd22e460e9aecb33e78e559a47e..bd51847acd57af10b37a474a23918e535af768d6 100644 (file)
@@ -247,8 +247,6 @@ static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct
                                           len, fl->proto, tmp_csum);
                icmp6h->icmp6_cksum = tmp_csum;
        }
-       if (icmp6h->icmp6_cksum == 0)
-               icmp6h->icmp6_cksum = -1;
        ip6_push_pending_frames(sk);
 out:
        return err;
index 18a90075f942a733b0c7f4f98d2c9dee3be2468a..813fa1d968627deaf5ab5b8500e20fd99e35480e 100644 (file)
@@ -536,7 +536,7 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl,
                                   &fl->fl6_dst,
                                   total_len, fl->proto, tmp_csum);
 
-       if (tmp_csum == 0)
+       if (tmp_csum == 0 && fl->proto == IPPROTO_UDP)
                tmp_csum = -1;
 
        csum = tmp_csum;