|
|
26b15f |
From c513cc3dd10231f267548d644dcb7632516a2348 Mon Sep 17 00:00:00 2001
|
|
|
26b15f |
From: Thomas Woerner <twoerner@redhat.com>
|
|
|
26b15f |
Date: Fri, 10 Jun 2016 14:57:58 +0200
|
|
|
26b15f |
Subject: ip6tables: Warn about use of DROP in nat table
|
|
|
26b15f |
|
|
|
26b15f |
Clone of 1eada72b with 9bb76094 and e0390bee on top.
|
|
|
26b15f |
|
|
|
26b15f |
Signed-off-by: Thomas Woerner <twoerner@redhat.com>
|
|
|
26b15f |
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
26b15f |
---
|
|
|
26b15f |
iptables/ip6tables.c | 7 +++++++
|
|
|
26b15f |
1 file changed, 7 insertions(+)
|
|
|
26b15f |
|
|
|
26b15f |
diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c
|
|
|
26b15f |
index 2731209..c48ddf9 100644
|
|
|
26b15f |
--- a/iptables/ip6tables.c
|
|
|
26b15f |
+++ b/iptables/ip6tables.c
|
|
|
26b15f |
@@ -1720,6 +1720,13 @@ int do_command6(int argc, char *argv[], char **table,
|
|
|
26b15f |
cs.invert = FALSE;
|
|
|
26b15f |
}
|
|
|
26b15f |
|
|
|
26b15f |
+ if (strcmp(*table, "nat") == 0 &&
|
|
|
26b15f |
+ ((policy != NULL && strcmp(policy, "DROP") == 0) ||
|
|
|
26b15f |
+ (cs.jumpto != NULL && strcmp(cs.jumpto, "DROP") == 0)))
|
|
|
26b15f |
+ xtables_error(PARAMETER_PROBLEM,
|
|
|
26b15f |
+ "\nThe \"nat\" table is not intended for filtering, "
|
|
|
26b15f |
+ "the use of DROP is therefore inhibited.\n\n");
|
|
|
26b15f |
+
|
|
|
26b15f |
for (matchp = cs.matches; matchp; matchp = matchp->next)
|
|
|
26b15f |
xtables_option_mfcall(matchp->match);
|
|
|
26b15f |
if (cs.target != NULL)
|
|
|
26b15f |
--
|
|
|
26b15f |
cgit v0.12
|
|
|
26b15f |
|