From: Jarno Rajahalme Date: Mon, 10 Feb 2014 16:52:25 +0000 (-0800) Subject: datapath: Read tcp flags only then the tranport header is present. X-Git-Tag: sliver-openvswitch-2.1.90-1~1^2~78 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=ac3e564e4392ef1fad53f329c14fa4972c87a952 datapath: Read tcp flags only then the tranport header is present. Only the first IP fragment can have a TCP header, check for this. Signed-off-by: Jarno Rajahalme Signed-off-by: Jesse Gross --- diff --git a/datapath/flow.c b/datapath/flow.c index 8be380182..abe678906 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -74,6 +74,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, struct sk_buff *skb) if ((flow->key.eth.type == htons(ETH_P_IP) || flow->key.eth.type == htons(ETH_P_IPV6)) && + flow->key.ip.frag != OVS_FRAG_TYPE_LATER && flow->key.ip.proto == IPPROTO_TCP && likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) { tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb));