Thread (1 message) 1 message, 1 author, 2014-03-20
DORMANTno replies

[PATCH net 2/4] openvswitch: Read tcp flags only then the tranport header is present.

From: Jesse Gross <hidden>
Date: 2014-03-20 18:09:12
Subsystem: networking [general], openvswitch, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Aaron Conole, Eelco Chaudron, Ilya Maximets, Linus Torvalds

From: Jarno Rajahalme <redacted>

Only the first IP fragment can have a TCP header, check for this.

Signed-off-by: Jarno Rajahalme <redacted>
Signed-off-by: Jesse Gross <redacted>
---
 net/openvswitch/flow.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index 16f4b46..d71e60f 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -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));
-- 
1.8.3.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help