aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2022-09-06 17:20:35 +0200
committerFlorian Westphal <fw@strlen.de>2022-09-07 16:46:04 +0200
commitc92c27171040554cfda7a3fc925e9dbcb5b4a698 (patch)
tree59d7fc3e6dbecbee86cb99add3454a1f999f5047 /include/net
parentnetfilter: move from strlcpy with unused retval to strscpy (diff)
downloadlinux-dev-c92c27171040554cfda7a3fc925e9dbcb5b4a698.tar.xz
linux-dev-c92c27171040554cfda7a3fc925e9dbcb5b4a698.zip
netfilter: nat: move repetitive nat port reserve loop to a helper
Almost all nat helpers reserve an expecation port the same way: Try the port inidcated by the peer, then move to next port if that port is already in use. We can squash this into a helper. Suggested-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netfilter/nf_nat_helper.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h
index efae84646353..44c421b9be85 100644
--- a/include/net/netfilter/nf_nat_helper.h
+++ b/include/net/netfilter/nf_nat_helper.h
@@ -38,4 +38,5 @@ bool nf_nat_mangle_udp_packet(struct sk_buff *skb, struct nf_conn *ct,
* to port ct->master->saved_proto. */
void nf_nat_follow_master(struct nf_conn *ct, struct nf_conntrack_expect *this);
+u16 nf_nat_exp_find_port(struct nf_conntrack_expect *exp, u16 port);
#endif