tree 42ea51265582ba2b38089fd347cf3e16cfea7538
parent fd841326d73096ad79be9c3fa348f9ad04541cc2
author Patrick McHardy <[EMAIL PROTECTED]> Sun, 21 Aug 2005 07:39:15 -0700
committer David S. Miller <[EMAIL PROTECTED]> Sun, 21 Aug 2005 07:39:15 -0700

[NETFILTER]: Fix HW checksum handling in ECN target

Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

 net/ipv4/netfilter/ipt_ECN.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c
--- a/net/ipv4/netfilter/ipt_ECN.c
+++ b/net/ipv4/netfilter/ipt_ECN.c
@@ -71,6 +71,10 @@ set_ect_tcp(struct sk_buff **pskb, const
                return 0;
        tcph = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4;
 
+       if ((*pskb)->ip_summed == CHECKSUM_HW &&
+           skb_checksum_help(*pskb, inward))
+               return 0;
+
        diffs[0] = ((u_int16_t *)tcph)[6];
        if (einfo->operation & IPT_ECN_OP_SET_ECE)
                tcph->ece = einfo->proto.tcp.ece;
@@ -79,13 +83,10 @@ set_ect_tcp(struct sk_buff **pskb, const
        diffs[1] = ((u_int16_t *)tcph)[6];
        diffs[0] = diffs[0] ^ 0xFFFF;
 
-       if ((*pskb)->ip_summed != CHECKSUM_HW)
+       if ((*pskb)->ip_summed != CHECKSUM_UNNECESSARY)
                tcph->check = csum_fold(csum_partial((char *)diffs,
                                                     sizeof(diffs),
                                                     tcph->check^0xFFFF));
-       else
-               if (skb_checksum_help(*pskb, inward))
-                       return 0;
        (*pskb)->nfcache |= NFC_ALTERED;
        return 1;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to