[ovs-dev] [PATCH net-next 1/7] openvswitch: Enable retrieval of TCP flags from IPv6 traffic.

Jesse Gross jesse at nicira.com
Fri Jul 20 22:26:44 UTC 2012


We currently check that a packet is IPv4 and TCP before fetching the
TCP flags.  This enables fetching from IPv6 packets as well.

Reported-by: Michael Mao <mmao at nicira.com>
Signed-off-by: Jesse Gross <jesse at nicira.com>
---
 net/openvswitch/flow.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index 2a11ec2..c6e1dae 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -182,7 +182,8 @@ void ovs_flow_used(struct sw_flow *flow, struct sk_buff *skb)
 {
 	u8 tcp_flags = 0;
 
-	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.ip.proto == IPPROTO_TCP &&
 	    likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) {
 		u8 *tcp = (u8 *)tcp_hdr(skb);
-- 
1.7.9.5




More information about the dev mailing list