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