summaryrefslogtreecommitdiffstats
path: root/net/openvswitch/flow.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-05-08 19:31:32 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-08 19:31:32 -0400
commitc5baa80ac879a3b38314f434c0a7255a2c2e4c86 (patch)
tree47b7f9e7ecedeacdcdcdbf89ac63b1d0093eebb6 /net/openvswitch/flow.c
parent1c430a727fa512500a422ffe4712166c550ea06a (diff)
parent072ae6314a191e3a9fc309b1e4e539ac7abc48ad (diff)
downloadop-kernel-dev-c5baa80ac879a3b38314f434c0a7255a2c2e4c86.zip
op-kernel-dev-c5baa80ac879a3b38314f434c0a7255a2c2e4c86.tar.gz
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch
Diffstat (limited to 'net/openvswitch/flow.c')
-rw-r--r--net/openvswitch/flow.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index 1252c30..2a11ec2 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -183,7 +183,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) &&
- flow->key.ip.proto == IPPROTO_TCP) {
+ flow->key.ip.proto == IPPROTO_TCP &&
+ likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) {
u8 *tcp = (u8 *)tcp_hdr(skb);
tcp_flags = *(tcp + TCP_FLAGS_OFFSET) & TCP_FLAG_MASK;
}
OpenPOWER on IntegriCloud