netfilter: introduce support for reject at prerouting stage
authorLaura Garcia Liebana <nevola@gmail.com>
Sun, 31 May 2020 20:26:23 +0000 (22:26 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 30 Jun 2020 16:21:02 +0000 (18:21 +0200)
commitf53b9b0bdc59c0823679f2e3214e0d538f5951b9
treeec4a73ff313b5481ecb726dcad675f41aab7c766
parent5fb62372a0207f1514fa6052c51991198c46ffe2
netfilter: introduce support for reject at prerouting stage

REJECT statement can be only used in INPUT, FORWARD and OUTPUT
chains. This patch adds support of REJECT, both icmp and tcp
reset, at PREROUTING stage.

The need for this patch comes from the requirement of some
forwarding devices to reject traffic before the natting and
routing decisions.

The main use case is to be able to send a graceful termination
to legitimate clients that, under any circumstances, the NATed
endpoints are not available. This option allows clients to
decide either to perform a reconnection or manage the error in
their side, instead of just dropping the connection and let
them die due to timeout.

It is supported ipv4, ipv6 and inet families for nft
infrastructure.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv4/netfilter/nf_reject_ipv4.c
net/ipv6/netfilter/nf_reject_ipv6.c
net/netfilter/nft_reject.c