From: Phil Oester <kernel@linuxace.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH,RFC] Route match, kernel
Date: Thu, 3 Jul 2008 09:27:29 -0700 [thread overview]
Message-ID: <20080703162729.GA19256@linuxace.com> (raw)
In-Reply-To: <alpine.LNX.1.10.0807030920280.20393@fbirervta.pbzchgretzou.qr>
On Thu, Jul 03, 2008 at 09:22:03AM +0200, Jan Engelhardt wrote:
>
> >+ case XT_ROUTE_SRC_EXISTS:
> >+ fl.nl_u.ip4_u.daddr = iph->saddr;
> >+ ret = fib_lookup(dev_net(in), &fl, &res);
> >+ if (ret == 0 && res.prefixlen != 0) {
> >+ fib_res_put(&res);
> >+ return true ^ info->invert;
> >+ }
> >+ case XT_ROUTE_SRC_EQ:
> >+ fl.nl_u.ip4_u.daddr = iph->saddr;
> >+ ret = fib_lookup(dev_net(in), &fl, &res);
> >+ if (ret == 0 && res.prefixlen == info->prefixlen) {
> >+ fib_res_put(&res);
> >+ return true;
> >+ }
> >+ break;
>
> Should not these be true ^ info->invert too?
No - invert is only supported on the *_EXISTS case. Didn't see any point
in supporting invert on gt/lt, but now that I think of it perhaps supporting
it on _EQ may be useful. But can you see a point on gt/lt?
> I would probably combine mode and invert, to save a byte.
Possible.
> >+static bool
> >+route_mt6(const struct sk_buff *skb, const struct net_device *in,
> >+ const struct net_device *out, const struct xt_match *match,
> >+ const void *matchinfo, int offset, unsigned int protoff,
> >+ bool *hotdrop)
> >+{
> >+ return 1;
> >+}
>
> If you do not support IPv6, do not write a function for it ;-)
OK, so I should have #if 0 it...but this is just an RFC and that was
listed in the TODO ;-)
Thanks for the review BTW.
Phil
next prev parent reply other threads:[~2008-07-03 16:27 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 [this message]
2008-07-03 7:26 ` [PATCH,RFC] Route match, user Jan Engelhardt
2008-07-03 16:29 ` Phil Oester
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=20080703162729.GA19256@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