Linux Netfilter development
 help / color / mirror / Atom feed
From: Phil Oester <kernel@linuxace.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH,RFC] Route match, user
Date: Thu, 3 Jul 2008 09:29:46 -0700	[thread overview]
Message-ID: <20080703162946.GB19256@linuxace.com> (raw)
In-Reply-To: <alpine.LNX.1.10.0807030922040.20393@fbirervta.pbzchgretzou.qr>

On Thu, Jul 03, 2008 at 09:26:04AM +0200, Jan Engelhardt wrote:
> 
> >+static const struct option route_opts[] = {
> >+	{ "route-src-exists", 0, NULL, '1' },
> >+	{ "route-src-eq", 1, NULL, '2' },
> >+	{ "route-src-gt", 1, NULL, '3' },
> >+	{ "route-src-lt", 1, NULL, '4' },
> >+	{ "route-dst-exists", 0, NULL, '5' },
> >+	{ "route-dst-eq", 1, NULL, '6' },
> >+	{ "route-dst-gt", 1, NULL, '7' },
> >+	{ "route-dst-lt", 1, NULL, '8' },
> >+	{ .name = NULL }
> >+};
> 
> You are mixing non-C99 and C99 style.

Copy/paste from other iptables code.  Guess a new match should remain
consistent.
 
> >+static int route_parse(int c, char **argv, int invert, unsigned int *flags,
> >+                       const void *entry, struct xt_entry_match **match)
> >+{
> >+	struct xt_route_info *info = (struct xt_route_info *) (*match)->data;
> >+	unsigned int value;
> >+
> >+	check_inverse(optarg, &invert, &optind, 0);
> 
> I would not bother supporting intraplaced ! at all. Just remove that line.

Sorry..."intraplaced"?
 
> >+		case '6':
> >+			if (invert) 
> >+				exit_error(PARAMETER_PROBLEM,
> >+						"route: unexpected `!'");
> >+
> >+			if (string_to_number(optarg, 1, 128, &value) == -1)
> >+				exit_error(PARAMETER_PROBLEM,
> >+				           "route: Expected prefix between 1 and 128");
> >+
> >+			info->mode = XT_ROUTE_DST_EQ;
> >+			info->value = value;
> >+			break;
> 
> There is a lot of code to unify between route_mt_parse and route_mt6_parse.

I suppose I could pass a 32 or 128 to a common function, yes.

Phil

  reply	other threads:[~2008-07-03 16:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-03  0:39 [PATCH,RFC] Route match Phil Oester
2008-07-03  7:18 ` Jan Engelhardt
2008-07-03  9:50   ` Jozsef Kadlecsik
2008-07-03 11:22     ` Jan Engelhardt
2008-07-03 12:39       ` Jozsef Kadlecsik
2008-07-03 13:13         ` Jan Engelhardt
2008-07-03 13:31           ` Jozsef Kadlecsik
2008-07-03 14:15             ` Jan Engelhardt
2008-07-03 22:02               ` Jozsef Kadlecsik
2008-07-03 23:02                 ` Jan Engelhardt
2008-07-04  0:19                   ` James King
2008-07-04  0:37                     ` Jan Engelhardt
2008-07-03 15:51       ` Krzysztof Oledzki
2008-07-03 16:07         ` Jan Engelhardt
2008-07-03 16:10           ` Patrick McHardy
2008-07-03 16:14           ` Krzysztof Oledzki
2008-07-03 16:14         ` Jan Engelhardt
2008-07-04 13:47           ` Benny Amorsen
2008-07-04 15:15       ` Henrik Nordstrom
2008-07-03 18:53     ` Patrick McHardy
2008-07-03 22:21       ` Jozsef Kadlecsik
2008-07-04 20:26         ` Jozsef Kadlecsik
2008-07-03  7:22 ` [PATCH,RFC] Route match, kernel Jan Engelhardt
2008-07-03 16:27   ` Phil Oester
2008-07-03  7:26 ` [PATCH,RFC] Route match, user Jan Engelhardt
2008-07-03 16:29   ` Phil Oester [this message]
2008-07-03 16:55     ` Jan Engelhardt

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=20080703162946.GB19256@linuxace.com \
    --to=kernel@linuxace.com \
    --cc=jengelh@medozas.de \
    --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