netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/2] openvswitch: Properly set L4 keys on "later" IP fragments.
@ 2019-08-24 16:58 Justin Pettit
  2019-08-24 16:58 ` [PATCH net 2/2] openvswitch: Clear the L4 portion of the key for "later" fragments Justin Pettit
  2019-08-25 16:54 ` [PATCH net 1/2] openvswitch: Properly set L4 keys on "later" IP fragments Pravin Shelar
  0 siblings, 2 replies; 7+ messages in thread
From: Justin Pettit @ 2019-08-24 16:58 UTC (permalink / raw)
  To: netdev, Pravin Shelar; +Cc: Joe Stringer

When IP fragments are reassembled before being sent to conntrack, the
key from the last fragment is used.  Unless there are reordering
issues, the last fragment received will not contain the L4 ports, so the
key for the reassembled datagram won't contain them.  This patch updates
the key once we have a reassembled datagram.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
---
 net/openvswitch/conntrack.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index 848c6eb55064..f40ad2a42086 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -524,6 +524,10 @@ static int handle_fragments(struct net *net, struct sw_flow_key *key,
 		return -EPFNOSUPPORT;
 	}
 
+	/* The key extracted from the fragment that completed this datagram
+	 * likely didn't have an L4 header, so regenerate it. */
+	ovs_flow_key_update(skb, key);
+
 	key->ip.frag = OVS_FRAG_TYPE_NONE;
 	skb_clear_hash(skb);
 	skb->ignore_df = 1;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-26 18:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-24 16:58 [PATCH net 1/2] openvswitch: Properly set L4 keys on "later" IP fragments Justin Pettit
2019-08-24 16:58 ` [PATCH net 2/2] openvswitch: Clear the L4 portion of the key for "later" fragments Justin Pettit
2019-08-25 17:00   ` Pravin Shelar
2019-08-25 16:54 ` [PATCH net 1/2] openvswitch: Properly set L4 keys on "later" IP fragments Pravin Shelar
2019-08-25 20:40   ` Pravin Shelar
2019-08-25 21:52     ` David Miller
2019-08-26 18:42     ` Justin Pettit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).