netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Woerner <twoerner@redhat.com>
To: netfilter-devel@vger.kernel.org
Cc: Thomas Woerner <twoerner@redhat.com>
Subject: [PATCH] ip6tables: Warn about use of DROP in nat table
Date: Fri, 10 Jun 2016 14:57:58 +0200	[thread overview]
Message-ID: <1465563478-7602-1-git-send-email-twoerner@redhat.com> (raw)

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

Signed-off-by: Thomas Woerner <twoerner@redhat.com>
---
:100644 100644 2731209... c48ddf9... M	iptables/ip6tables.c
 iptables/ip6tables.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c
index 2731209..c48ddf9 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)
-- 
2.5.5


             reply	other threads:[~2016-06-10 12:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 12:57 Thomas Woerner [this message]
2016-06-15 12:28 ` [PATCH] ip6tables: Warn about use of DROP in nat table Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465563478-7602-1-git-send-email-twoerner@redhat.com \
    --to=twoerner@redhat.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).