summaryrefslogtreecommitdiffstats
path: root/iptables/ip6tables.c
diff options
context:
space:
mode:
authorThomas Woerner <twoerner@redhat.com>2016-06-10 14:57:58 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2016-06-15 14:28:32 +0200
commitc513cc3dd10231f267548d644dcb7632516a2348 (patch)
treefd2313f232c7a3fdba9d941891e462e5e33d3069 /iptables/ip6tables.c
parente5666f68d98bc2eedd5b3aad5bdd1840c4ced193 (diff)
ip6tables: Warn about use of DROP in nat table
Clone of 1eada72b with 9bb76094 and e0390bee on top. Signed-off-by: Thomas Woerner <twoerner@redhat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/ip6tables.c')
-rw-r--r--iptables/ip6tables.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c
index 2731209e..c48ddf9e 100644
--- a/iptables/ip6tables.c
+++ b/iptables/ip6tables.c
@@ -1720,6 +1720,13 @@ int do_command6(int argc, char *argv[], char **table,
cs.invert = FALSE;
}
+ if (strcmp(*table, "nat") == 0 &&
+ ((policy != NULL && strcmp(policy, "DROP") == 0) ||
+ (cs.jumpto != NULL && strcmp(cs.jumpto, "DROP") == 0)))
+ xtables_error(PARAMETER_PROBLEM,
+ "\nThe \"nat\" table is not intended for filtering, "
+ "the use of DROP is therefore inhibited.\n\n");
+
for (matchp = cs.matches; matchp; matchp = matchp->next)
xtables_option_mfcall(matchp->match);
if (cs.target != NULL)