Skip to contentSkip to conversation

ip6tables: Warn about use of DROP in nat table

PATCH Applied Thomas Woerner 2 participants 2 messages Jun 10, 2016 – Jun 15, 2016 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip6tables: Warn about use of DROP in nat table

Clone of 1eada72b with 9bb76094 and e0390bee on top.

---
:100644 100644 2731209... c48ddf9... M iptables/ip6tables.c

 iptables/ip6tables.c | 7 +++++++
 1 file changed, 7 insertions(+)
iptables/ip6tables.c +7 -0
index 2731209..c48ddf9 100644
@@ -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)
Signature · 1 line
2.5.5
maintainer Applied
#1 lore raw
Quoted 1 line · Thomas Woerner

Clone of 1eada72b with 9bb76094 and e0390bee on top.

Applied, thanks Thomas.