datapath: STT: Fix checksum handling.
authorPravin B Shelar <pshelar@ovn.org>
Fri, 4 Mar 2016 00:15:40 +0000 (16:15 -0800)
committerPravin B Shelar <pshelar@ovn.org>
Fri, 4 Mar 2016 00:15:40 +0000 (16:15 -0800)
On packet receive STT verifies the checksum if not done in
hardware. But IP and TCP were pulled before the verification
step. The verification expect to see packet with TCP header.
This causes STT to drop packet in certain cases.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
datapath/linux/compat/stt.c

index 5b68577..eb397e8 100644 (file)
@@ -1347,6 +1347,7 @@ static void stt_rcv(struct stt_dev *stt_dev, struct sk_buff *skb)
        if (unlikely(!validate_checksum(skb)))
                goto drop;
 
+       __skb_pull(skb, sizeof(struct tcphdr));
        skb = reassemble(skb);
        if (!skb)
                return;
@@ -1490,7 +1491,7 @@ static unsigned int nf_ip_hook(FIRST_PARAM, struct sk_buff *skb, LAST_PARAM)
        if (!stt_dev)
                return NF_ACCEPT;
 
-       __skb_pull(skb, ip_hdr_len + sizeof(struct tcphdr));
+       __skb_pull(skb, ip_hdr_len);
        stt_rcv(stt_dev, skb);
        return NF_STOLEN;
 }