Skip to content

Commit

Permalink
openvswitch: Enable retrieval of TCP flags from IPv6 traffic.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jesse Gross committed Apr 2, 2012
1 parent bf32fec commit c55177e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/openvswitch/flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c55177e

Please sign in to comment.