OSDN Git Service

netfilter: have ip*t REJECT set the sock err when an icmp is to be sent
authorJP Abgrall <jpa@google.com>
Thu, 16 Jun 2011 21:37:03 +0000 (14:37 -0700)
committerJP Abgrall <jpa@google.com>
Wed, 22 Jun 2011 22:29:03 +0000 (15:29 -0700)
commita6b1df961bcb86d6dcf7695a6b814ced3651a21e
tree954820bc40e3fd30677a6f03879aae1014471875
parent1c6aca9870a26e510ede67ae02a327ef888c18aa
netfilter: have ip*t REJECT set the sock err when an icmp is to be sent

(Backport from android-3.0 8c7bad8b84b5f89debf76f8ed29cf63bafe0bb67)

Allow the REJECT --reject-with icmp*blabla to also set the matching error
locally on the socket affected by the reject.
This allows the process to see an error almost as if it received it
via ICMP.
It avoids the local process who's ingress packet is rejected to have to
wait for a pseudo-eternity until some timeout kicks in.

Ideally, this should be enabled with a new iptables flag similar to
   --reject-with-sock-err
For now it is enabled with CONFIG_IP*_NF_TARGET_REJECT_SKERR option.

Change-Id: I649a4fd5940029ec0b3233e5abb205da6984891e
Signed-off-by: JP Abgrall <jpa@google.com>
net/ipv4/netfilter/Kconfig
net/ipv4/netfilter/ipt_REJECT.c
net/ipv6/netfilter/Kconfig
net/ipv6/netfilter/ip6t_REJECT.c