]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
finally commit the overly delayed RFC1812 admin prohibited option
authorHarald Welte <laforge@gnumonks.org>
Sat, 24 May 2003 11:44:18 +0000 (11:44 +0000)
committerHarald Welte <laforge@gnumonks.org>
Sat, 24 May 2003 11:44:18 +0000 (11:44 +0000)
INCOMPATIBILITIES [new file with mode: 0644]
extensions/libipt_REJECT.c
iptables.8

diff --git a/INCOMPATIBILITIES b/INCOMPATIBILITIES
new file mode 100644 (file)
index 0000000..fd695e1
--- /dev/null
@@ -0,0 +1,6 @@
+INCOMPATIBILITIES:
+
+- The REJECT target has an '--reject-with admin-prohib' option which used
+  with kernels that do not support it, will result in a plain DROP instead
+  of REJECT.  Use with caution.
+  Kernels that do support it:
index ba63a0aae5d984713037b0736b6f53c214aec88d..8170edd806b88b98c8f09e10c67b5e28d66b8928 100644 (file)
@@ -9,6 +9,16 @@
 #include <iptables.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
 #include <linux/netfilter_ipv4/ipt_REJECT.h>
+#include <linux/version.h>
+
+/* If we are compiling against a kernel that does not support
+ * IPT_ICMP_ADMIN_PROHIBITED, we are emulating it.
+ * The result will be a plain DROP of the packet instead of
+ * reject. -- Maciej Soltysiak <solt@dns.toxicfilms.tv>
+ */
+#ifndef IPT_ICMP_ADMIN_PROHIBITED
+#define IPT_ICMP_ADMIN_PROHIBITED      IPT_TCP_RESET + 1
+#endif
 
 struct reject_names {
        const char *name;
@@ -35,7 +45,9 @@ static const struct reject_names reject_table[] = {
        {"icmp-host-prohibited", "host-prohib",
         IPT_ICMP_HOST_PROHIBITED, "ICMP host prohibited"},
        {"tcp-reset", "tcp-reset",
-        IPT_TCP_RESET, "TCP RST packet"}
+        IPT_TCP_RESET, "TCP RST packet"},
+       {"icmp-admin-prohibited", "admin-prohib",
+        IPT_ICMP_ADMIN_PROHIBITED, "ICMP administratively prohibited (*)"}
 };
 
 static void
@@ -64,6 +76,8 @@ help(void)
 "                                a reply packet according to type:\n");
 
        print_reject_types();
+
+       printf("(*) See man page or read the INCOMPATIBILITES file for compatibility issues.\n");
 }
 
 static struct option opts[] = {
index bd58e09c6c6e7ef30c0320ce35052bb153878f2d..f73ff4628a867bfd439fbd2c47ba436ce88d207f 100644 (file)
@@ -864,8 +864,9 @@ The type given can be
 .BR icmp-host-unreachable ,
 .BR icmp-port-unreachable ,
 .BR icmp-proto-unreachable ,
-.BR "icmp-net-prohibited or"
-.BR icmp-host-prohibited ,
+.BR icmp-net-prohibited ,
+.BR "icmp-host-prohibited or"
+.BR "icmp-admin-prohibited (*)"
 which return the appropriate ICMP error message (\fBport-unreachable\fP is
 the default).  The option
 .B tcp-reset
@@ -874,6 +875,8 @@ TCP RST packet to be sent back.  This is mainly useful for blocking
 .I ident
 (113/tcp) probes which frequently occur when sending mail to broken mail
 hosts (which won't accept your mail otherwise).
+.TP
+(*) Using icmp-admin-prohibited with kernels that do not support it will result in a plain DROP instead of REJECT
 .SS SNAT
 This target is only valid in the
 .B nat