Commit 3b5d5728 authored by Maciej Soltysiak's avatar Maciej Soltysiak Committed by David S. Miller

[NETFILTER]: Make REJECT target compliant with RFC 1812.

Add support for iptables --reject-with-admin-prohib option
of the REJECT target, making it compliant with RFC 1812.
parent c828efd5
...@@ -9,7 +9,8 @@ enum ipt_reject_with { ...@@ -9,7 +9,8 @@ enum ipt_reject_with {
IPT_ICMP_ECHOREPLY, IPT_ICMP_ECHOREPLY,
IPT_ICMP_NET_PROHIBITED, IPT_ICMP_NET_PROHIBITED,
IPT_ICMP_HOST_PROHIBITED, IPT_ICMP_HOST_PROHIBITED,
IPT_TCP_RESET IPT_TCP_RESET,
IPT_ICMP_ADMIN_PROHIBITED
}; };
struct ipt_reject_info { struct ipt_reject_info {
......
/* /*
* This is a module which is used for rejecting packets. * This is a module which is used for rejecting packets.
* Added support for customized reject packets (Jozsef Kadlecsik). * Added support for customized reject packets (Jozsef Kadlecsik).
* Added support for ICMP type-3-code-13 (Maciej Soltysiak). [RFC 1812]
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -387,6 +388,9 @@ static unsigned int reject(struct sk_buff **pskb, ...@@ -387,6 +388,9 @@ static unsigned int reject(struct sk_buff **pskb,
case IPT_ICMP_HOST_PROHIBITED: case IPT_ICMP_HOST_PROHIBITED:
send_unreach(*pskb, ICMP_HOST_ANO); send_unreach(*pskb, ICMP_HOST_ANO);
break; break;
case IPT_ICMP_ADMIN_PROHIBITED:
send_unreach(*pskb, ICMP_PKT_FILTERED);
break;
case IPT_TCP_RESET: case IPT_TCP_RESET:
send_reset(*pskb, hooknum == NF_IP_LOCAL_IN); send_reset(*pskb, hooknum == NF_IP_LOCAL_IN);
case IPT_ICMP_ECHOREPLY: case IPT_ICMP_ECHOREPLY:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment