76 lines
2.6 KiB
Diff
76 lines
2.6 KiB
Diff
|
|
From d94ae5c5bf9ffa4d405515a1ba194143465e9ac1 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Florian Westphal <fw@strlen.de>
|
||
|
|
Date: Fri, 10 May 2019 12:30:12 -0700
|
||
|
|
Subject: [PATCH] openvswitch: use nf_ct_get_tuplepr, invert_tuplepr
|
||
|
|
|
||
|
|
Upstream commit:
|
||
|
|
commit 60e3be94e6a1c5162a0763c9aafb5190b2b1fdce
|
||
|
|
Author: Florian Westphal <fw@strlen.de>
|
||
|
|
Date: Mon Jun 25 17:55:32 2018 +0200
|
||
|
|
|
||
|
|
openvswitch: use nf_ct_get_tuplepr, invert_tuplepr
|
||
|
|
|
||
|
|
These versions deal with the l3proto/l4proto details internally.
|
||
|
|
It removes only caller of nf_ct_get_tuple, so make it static.
|
||
|
|
|
||
|
|
After this, l3proto->get_l4proto() can be removed in a followup patch.
|
||
|
|
|
||
|
|
Signed-off-by: Florian Westphal <fw@strlen.de>
|
||
|
|
Acked-by: Pravin B Shelar <pshelar@ovn.org>
|
||
|
|
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||
|
|
|
||
|
|
This patch backports the above upstream kernel patch to OVS.
|
||
|
|
|
||
|
|
Cc: Florian Westphal <fw@strlen.de>
|
||
|
|
Tested-by: Greg Rose <gvrose8192@gmail.com>
|
||
|
|
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
|
||
|
|
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
|
||
|
|
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
|
||
|
|
Signed-off-by: Ben Pfaff <blp@ovn.org>
|
||
|
|
---
|
||
|
|
datapath/conntrack.c | 17 +++--------------
|
||
|
|
1 file changed, 3 insertions(+), 14 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/datapath/conntrack.c b/datapath/conntrack.c
|
||
|
|
index a7dc9e0..0d8f61f 100644
|
||
|
|
--- a/datapath/conntrack.c
|
||
|
|
+++ b/datapath/conntrack.c
|
||
|
|
@@ -645,23 +645,12 @@ static struct nf_conn *
|
||
|
|
ovs_ct_find_existing(struct net *net, const struct nf_conntrack_zone *zone,
|
||
|
|
u8 l3num, struct sk_buff *skb, bool natted)
|
||
|
|
{
|
||
|
|
- const struct nf_conntrack_l3proto *l3proto;
|
||
|
|
- const struct nf_conntrack_l4proto *l4proto;
|
||
|
|
struct nf_conntrack_tuple tuple;
|
||
|
|
struct nf_conntrack_tuple_hash *h;
|
||
|
|
struct nf_conn *ct;
|
||
|
|
- unsigned int dataoff;
|
||
|
|
- u8 protonum;
|
||
|
|
|
||
|
|
- l3proto = __nf_ct_l3proto_find(l3num);
|
||
|
|
- if (l3proto->get_l4proto(skb, skb_network_offset(skb), &dataoff,
|
||
|
|
- &protonum) <= 0) {
|
||
|
|
- pr_debug("ovs_ct_find_existing: Can't get protonum\n");
|
||
|
|
- return NULL;
|
||
|
|
- }
|
||
|
|
- l4proto = __nf_ct_l4proto_find(l3num, protonum);
|
||
|
|
- if (!nf_ct_get_tuple(skb, skb_network_offset(skb), dataoff, l3num,
|
||
|
|
- protonum, net, &tuple, l3proto, l4proto)) {
|
||
|
|
+ if (!nf_ct_get_tuplepr(skb, skb_network_offset(skb), l3num,
|
||
|
|
+ net, &tuple)) {
|
||
|
|
pr_debug("ovs_ct_find_existing: Can't get tuple\n");
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
@@ -670,7 +659,7 @@ ovs_ct_find_existing(struct net *net, const struct nf_conntrack_zone *zone,
|
||
|
|
if (natted) {
|
||
|
|
struct nf_conntrack_tuple inverse;
|
||
|
|
|
||
|
|
- if (!nf_ct_invert_tuple(&inverse, &tuple, l3proto, l4proto)) {
|
||
|
|
+ if (!nf_ct_invert_tuplepr(&inverse, &tuple)) {
|
||
|
|
pr_debug("ovs_ct_find_existing: Inversion failed!\n");
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
--
|
||
|
|
2.14.1
|
||
|
|
|