openvswitch: Enable retrieval of TCP flags from IPv6 traffic.
authorJesse Gross <jesse@nicira.com>
Mon, 2 Apr 2012 22:13:36 +0000 (15:13 -0700)
committerJesse Gross <jesse@nicira.com>
Mon, 2 Apr 2012 22:13:36 +0000 (15:13 -0700)
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@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
net/openvswitch/flow.c

index 2a11ec2383eede7b653a36d09b46f1048e6f0434..c6e1dae8a5ee1951978455b75c462ec156fc9e89 100644 (file)
@@ -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);