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: Jarno Rajahalme <jrajahalme@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
This commit is contained in:
committed by
Jesse Gross
parent
3c7eacfc8a
commit
04382a3303
@@ -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) ||
|
if ((flow->key.eth.type == htons(ETH_P_IP) ||
|
||||||
flow->key.eth.type == htons(ETH_P_IPV6)) &&
|
flow->key.eth.type == htons(ETH_P_IPV6)) &&
|
||||||
|
flow->key.ip.frag != OVS_FRAG_TYPE_LATER &&
|
||||||
flow->key.ip.proto == IPPROTO_TCP &&
|
flow->key.ip.proto == IPPROTO_TCP &&
|
||||||
likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) {
|
likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) {
|
||||||
tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb));
|
tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb));
|
||||||
|
|||||||
Reference in New Issue
Block a user