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)
committerArve Hjønnevåg <arve@android.com>
Mon, 1 Jul 2013 20:40:35 +0000 (13:40 -0700)
commit6f489c42a92e0e33d4257017d6fd4a3e79f75f79
treec7b0cf47b90c08227b07231a73255d655b37029b
parent22aca520a559153df0339ee24cce30de4d1b0ee8
netfilter: have ip*t REJECT set the sock err when an icmp is to be sent

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