From: Pravin B Shelar Date: Fri, 4 Mar 2016 00:15:40 +0000 (-0800) Subject: datapath: STT: Fix checksum handling. X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=c26d70a2452ad0d7a13b72c94641d08001283119 datapath: STT: Fix checksum handling. 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 Acked-by: Joe Stringer --- diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c index 5b6857717..eb397e85b 100644 --- a/datapath/linux/compat/stt.c +++ b/datapath/linux/compat/stt.c @@ -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; }