summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@ovn.org>2019-09-04 10:07:24 -0700
committerJustin Pettit <jpettit@ovn.org>2019-09-04 15:23:33 -0700
commitdeb89f49db5e2910926359a3ce4e4989cec1f8e9 (patch)
tree2016fe6344cedf09f5701180a95d8cdc9db3c35d
parenta214078f665dccd4632af56ad0b20fcc29c8a99c (diff)
downloadopenvswitch-deb89f49db5e2910926359a3ce4e4989cec1f8e9.tar.gz
datapath: Clear the L4 portion of the key for "later" fragments
Upstream commit: commit 0754b4e8cdf3eec6e4122e79af26ed9bab20f8f8 Author: Justin Pettit <jpettit@ovn.org> Date: Tue Aug 27 07:58:10 2019 -0700 openvswitch: Clear the L4 portion of the key for "later" fragments. Only the first fragment in a datagram contains the L4 headers. When the Open vSwitch module parses a packet, it always sets the IP protocol field in the key, but can only set the L4 fields on the first fragment. The original behavior would not clear the L4 portion of the key, so garbage values would be sent in the key for "later" fragments. This patch clears the L4 fields in that circumstance to prevent sending those garbage values as part of the upcall. Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Pravin B Shelar <pshelar@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
-rw-r--r--datapath/flow.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/datapath/flow.c b/datapath/flow.c
index 083288fa4..30eed20fe 100644
--- a/datapath/flow.c
+++ b/datapath/flow.c
@@ -529,6 +529,7 @@ static int key_extract_l3l4(struct sk_buff *skb, struct sw_flow_key *key)
offset = nh->frag_off & htons(IP_OFFSET);
if (offset) {
key->ip.frag = OVS_FRAG_TYPE_LATER;
+ memset(&key->tp, 0, sizeof(key->tp));
return 0;
}
if (nh->frag_off & htons(IP_MF) ||
@@ -647,8 +648,10 @@ static int key_extract_l3l4(struct sk_buff *skb, struct sw_flow_key *key)
return error;
}
- if (key->ip.frag == OVS_FRAG_TYPE_LATER)
+ if (key->ip.frag == OVS_FRAG_TYPE_LATER) {
+ memset(&key->tp, 0, sizeof(key->tp));
return 0;
+ }
if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP)
key->ip.frag = OVS_FRAG_TYPE_FIRST;