Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04382a33 authored by Jarno Rajahalme's avatar Jarno Rajahalme Committed by Jesse Gross
Browse files

openvswitch: 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: default avatarJarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: default avatarJesse Gross <jesse@nicira.com>
parent 3c7eacfc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,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));