OSDN Git Service

netfilter: nat: move repetitive nat port reserve loop to a helper
authorFlorian Westphal <fw@strlen.de>
Tue, 6 Sep 2022 15:20:35 +0000 (17:20 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 7 Sep 2022 14:46:04 +0000 (16:46 +0200)
commitc92c27171040554cfda7a3fc925e9dbcb5b4a698
tree59d7fc3e6dbecbee86cb99add3454a1f999f5047
parent8556bceb9c409946eebd2303d2f19e87844195ae
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>
include/net/netfilter/nf_nat_helper.h
net/ipv4/netfilter/nf_nat_h323.c
net/netfilter/nf_nat_amanda.c
net/netfilter/nf_nat_ftp.c
net/netfilter/nf_nat_helper.c
net/netfilter/nf_nat_irc.c
net/netfilter/nf_nat_sip.c