Linux Netfilter development
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Phil Oester <kernel@linuxace.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH,RFC] Route match v2
Date: Mon, 07 Jul 2008 19:33:15 +0200	[thread overview]
Message-ID: <4872535B.9050200@trash.net> (raw)
In-Reply-To: <20080707170545.GA31948@linuxace.com>

Phil Oester wrote:
> On Mon, Jul 07, 2008 at 02:00:32PM +0200, Patrick McHardy wrote:
>>> +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)
>>> +{
>>> +	const struct xt_route_info *info = matchinfo;
>>> +	const struct ipv6hdr *iph = ipv6_hdr(skb);
>>> +	struct fib6_node *fn;
>>> +	struct flowi fl = {0};
>>> +
>>> +	switch (info->mode) {
>>> +	case XT_ROUTE_SRC_EXISTS:
>>> +		fl.nl_u.ip6_u.daddr = iph->saddr;
>>> +		fn = fib6_lookup(&dev_net(in)->ipv6.fib6_main_tbl->tb6_root, &fl.fl6_dst, NULL);
>> This is always using the main table, which is inconsistent
>> with the IPv4 support. It also shouldn't call IPv6 functions
>> directly to avoid incorrect module dependencies.
> 
> What are the alternatives?  If we need to support IPv6 in the match, then
> we need to call the functions directly, no?  Is there a helper function
> I'm missing?

There are the ->route functions is nf_afinfo, but I'm not sure
if they will work for you. You may have too add some new ones.


      reply	other threads:[~2008-07-07 17:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-04 18:43 [PATCH,RFC] Route match v2 Phil Oester
2008-07-07 12:00 ` Patrick McHardy
2008-07-07 17:05   ` Phil Oester
2008-07-07 17:33     ` Patrick McHardy [this message]

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=4872535B.9050200@trash.net \
    --to=kaber@trash.net \
    --cc=kernel@linuxace.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