All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Oester <kernel@linuxace.com>
To: netfilter-devel@lists.netfilter.org
Subject: [PATCH] disallow multiple matches of same type
Date: Sun, 19 Feb 2006 21:54:21 -0800	[thread overview]
Message-ID: <20060220055421.GA10552@linuxace.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

In latest iptables SVN, the command:

iptables -A foo -p tcp -m multiport --dport 45,47 -m multiport --sport 45:48

ends up with mangled results of:

... multiport sports  multiport sports  tcp spts:45:48

Since at present, iptables can only handle one match of a given type
per rule.  The below patch makes sure we disallow more than one.

This closes bugzilla #447

Phil



[-- Attachment #2: patch-nomultimatch --]
[-- Type: text/plain, Size: 564 bytes --]

--- ipt-orig/iptables.c	2006-02-11 01:50:11.000000000 -0800
+++ ipt-new/iptables.c	2006-02-19 21:46:03.000000000 -0800
@@ -2125,6 +2125,11 @@
 				exit_error(PARAMETER_PROBLEM,
 					   "unexpected ! flag before --match");
 
+			for (matchp = matches; matchp; matchp = matchp->next) {
+				if (strcmp(optarg, matchp->match->name) == 0)
+					exit_error(PARAMETER_PROBLEM,
+						   "multiple matches of same type not supported");
+			}
 			m = find_match(optarg, LOAD_MUST_SUCCEED, &matches);
 			size = IPT_ALIGN(sizeof(struct ipt_entry_match))
 					 + m->size;

             reply	other threads:[~2006-02-20  5:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-20  5:54 Phil Oester [this message]
2006-02-20 17:38 ` [PATCH] disallow multiple matches of same type Patrick McHardy
2006-02-20 18:31   ` Phil Oester
2006-02-20 18:49     ` Harald Welte

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=20060220055421.GA10552@linuxace.com \
    --to=kernel@linuxace.com \
    --cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.