netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: Ville Nuorvala <vnuorval@tcs.hut.fi>
Cc: "David S. Miller" <davem@davemloft.net>,
	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>,
	kim.nordlund@nokia.com, netdev@vger.kernel.org
Subject: Re: [PATCH 13/13] [RFC] [IPV6] Fix source prefix routing problems when source address undefined.
Date: Tue, 17 Oct 2006 12:14:02 +0200	[thread overview]
Message-ID: <20061017101402.GM12964@postel.suug.ch> (raw)
In-Reply-To: <4534237B.9090205@tcs.hut.fi>

* Ville Nuorvala <vnuorval@tcs.hut.fi> 2006-10-17 03:27
> @@ -123,7 +111,7 @@ static int fib6_rule_match(struct fib_ru
>  		return 0;
> 
>  	if (r->src.plen) {
> -		if (!(flags & RT6_LOOKUP_F_HAS_SADDR) ||
> +		if (flags & RT6_LOOKUP_F_HAS_SADDR &&
>  		    !ipv6_prefix_equal(&fl->fl6_src, &r->src.addr, r->src.plen))
>  			return 0;
>  	}

This is wrong, rules matching on a source prefix must fail if no
source address is available.

>  static struct rt6_info *ip6_pol_route_output(struct fib6_table *table,
> -					     struct flowi *fl, int flags)
> +					     struct flowi *fl, int flags,
> +					     struct fib6_rule *rule)
>  {
>  	struct fib6_node *fn;
>  	struct rt6_info *rt, *nrt;
> @@ -730,6 +733,16 @@ static struct rt6_info *ip6_pol_route_ou
>  	struct in6_addr saddr;
> 
>  	ipv6_addr_copy(&saddr, &fl->fl6_src);
> +#ifdef CONFIG_IPV6_SUBTREES
> +	if (!has_saddr && rule->src.plen > 0) {
> +		/* a source prefix specific policy rule has to override the
> +		   normal source address selection process */
> +		if (ipv6_get_saddr(fl->oif, &fl->fl6_dst, &rule->src, &saddr))
> +			goto no_saddr;
> +		has_saddr = RT6_LOOKUP_F_HAS_SADDR;
> +		ipv6_addr_copy(&fl->fl6_src, &saddr);
> +	}
> +#endif
>  relookup:
>  	read_lock_bh(&table->tb6_lock);

I can see why you want the above change but we have to find another way.

  reply	other threads:[~2006-10-17 10:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-17  0:27 [PATCH 13/13] [RFC] [IPV6] Fix source prefix routing problems when source address undefined Ville Nuorvala
2006-10-17 10:14 ` Thomas Graf [this message]
2006-10-17 11:00   ` YOSHIFUJI Hideaki / 吉藤英明
2006-10-17 11:35     ` Thomas Graf
2006-10-17 12:17       ` YOSHIFUJI Hideaki / 吉藤英明
2006-10-17 12:34         ` Thomas Graf
2006-10-17 16:49           ` YOSHIFUJI Hideaki / 吉藤英明
2006-10-17 20:11       ` Ville Nuorvala

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=20061017101402.GM12964@postel.suug.ch \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=kim.nordlund@nokia.com \
    --cc=netdev@vger.kernel.org \
    --cc=vnuorval@tcs.hut.fi \
    --cc=yoshfuji@linux-ipv6.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).