diff options
author | David S. Miller <davem@davemloft.net> | 2022-12-12 10:14:03 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-12-12 10:14:03 +0000 |
commit | 21af0d557ea932e50094a48adb20e356e2f6ffef (patch) | |
tree | 229260979b87bd6cd585ebf94fbd7939fa8254cd /include | |
parent | a2d40ce7acdbf4641235ee8be4b4d338746c03b5 (diff) | |
parent | ebddb1404900657b7f03a56ee4c34a9d218c4030 (diff) | |
download | linux-21af0d557ea932e50094a48adb20e356e2f6ffef.tar.bz2 |
Merge branch 'ovs-tc-dedup'
Xin Long says:
====================
net: eliminate the duplicate code in the ct nat functions of ovs and tc
The changes in the patchset:
"net: add helper support in tc act_ct for ovs offloading"
had moved some common ct code used by both OVS and TC into netfilter.
There are still some big functions pretty similar defined and used in
each of OVS and TC. It is not good to maintain such big function in 2
places. This patchset is to extract the functions for NAT processing
from OVS and TC to netfilter.
To make this change clear and safe, this patchset gets the common code
out of OVS and TC step by step: The patch 1-4 make some minor changes
in OVS and TC to make the NAT code of them completely the same, then
the patch 5 moves the common code to the netfilter and exports one
function called by each of OVS and TC.
v1->v2:
- Create nf_nat_ovs.c to include the nat functions, as Pablo suggested.
v2->v3:
- fix a typo in subject of patch 2/5, as Marcelo noticed.
- fix in openvswitch to keep OVS ct nat and TC ct nat consistent in
patch 3/5 instead of in tc, as Marcelo noticed.
- use BIT(var) macro instead of (1 << var) in patch 5/5, as Marcelo
suggested.
- use ifdef in netfilter/Makefile to build nf_nat_ovs only when OVS
or TC ct action is enabled in patch 5/5, as Marcelo suggested.
v3->v4:
- add NF_NAT_OVS in netfilter/Kconfig and add select NF_NAT_OVS in
OVS and TC Kconfig instead of using ifdef in netfilter/Makefile,
as Pablo suggested.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/netfilter/nf_nat.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h index e9eb01e99d2f..9877f064548a 100644 --- a/include/net/netfilter/nf_nat.h +++ b/include/net/netfilter/nf_nat.h @@ -104,6 +104,10 @@ unsigned int nf_nat_inet_fn(void *priv, struct sk_buff *skb, const struct nf_hook_state *state); +int nf_ct_nat(struct sk_buff *skb, struct nf_conn *ct, + enum ip_conntrack_info ctinfo, int *action, + const struct nf_nat_range2 *range, bool commit); + static inline int nf_nat_initialized(const struct nf_conn *ct, enum nf_nat_manip_type manip) { |