Netdev List
 help / color / mirror / Atom feed
From: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
To: davem@davemloft.net
Cc: mroos@linux.ee, yoshfuji@linux-ipv6.org, netdev@vger.kernel.org
Subject: [PATCH] [IPV6] ROUTE: Don't try less preferred routes for on-link routes.
Date: Fri, 26 May 2006 20:01:56 +0900 (JST)	[thread overview]
Message-ID: <20060526.200156.83522671.yoshfuji@linux-ipv6.org> (raw)
In-Reply-To: <Pine.SOC.4.61.0605261344340.26383@math.ut.ee>

David,

In article <Pine.SOC.4.61.0605261344340.26383@math.ut.ee> (at Fri, 26 May 2006 13:44:59 +0300 (EEST)), Meelis Roos <mroos@linux.ee> says:

> >> The unreachable route works now but LAN routing still does not work.
> >> Locally generated ICMPv6 packets that should go to LAN interface still
> >> go to tun6to4.
> >
> > Please try this.
> 
> This works for both unreachable and LAN routes, thanks!

Please push this to 2.6.17-final.

Regards,

-------
[IPV6] ROUTE: Don't try less preferred routes for on-link routes.

In addition to the real on-link routes, NONEXTHOP routes
should be considered on-link.

Problem reported by Meelis Roos <mroos@linux.ee>.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Acked-by: Meelis Roos <mroos@linux.ee>

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 0190e39..8a77793 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -280,10 +280,13 @@ static int inline rt6_check_neigh(struct
 {
 	struct neighbour *neigh = rt->rt6i_nexthop;
 	int m = 0;
-	if (neigh) {
+	if (rt->rt6i_flags & RTF_NONEXTHOP ||
+	    !(rt->rt6i_flags & RTF_GATEWAY))
+		m = 1;
+	else if (neigh) {
 		read_lock_bh(&neigh->lock);
 		if (neigh->nud_state & NUD_VALID)
-			m = 1;
+			m = 2;
 		read_unlock_bh(&neigh->lock);
 	}
 	return m;
@@ -292,15 +295,18 @@ static int inline rt6_check_neigh(struct
 static int rt6_score_route(struct rt6_info *rt, int oif,
 			   int strict)
 {
-	int m = rt6_check_dev(rt, oif);
+	int m, n;
+		
+	m = rt6_check_dev(rt, oif);
 	if (!m && (strict & RT6_SELECT_F_IFACE))
 		return -1;
 #ifdef CONFIG_IPV6_ROUTER_PREF
 	m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2;
 #endif
-	if (rt6_check_neigh(rt))
+	n = rt6_check_neigh(rt);
+	if (n > 1)
 		m |= 16;
-	else if (strict & RT6_SELECT_F_REACHABLE)
+	else if (!n && strict & RT6_SELECT_F_REACHABLE)
 		return -1;
 	return m;
 }

-- 
YOSHIFUJI Hideaki @ USAGI Project  <yoshfuji@linux-ipv6.org>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

  reply	other threads:[~2006-05-26 11:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-15  6:18 ipv6 routing broken in 2.6.17-rc3,4 Meelis Roos
2006-05-15 16:05 ` Pekka Savola
2006-05-15 17:30   ` Meelis Roos
2006-05-15 17:38   ` Meelis Roos
2006-05-25 20:17   ` Meelis Roos
2006-05-25 23:24   ` Meelis Roos
2006-05-26  1:40     ` YOSHIFUJI Hideaki / 吉藤英明
     [not found]       ` <20060526.104245.106225873.yoshfuji@linux-ipv6.org>
2006-05-26  8:35         ` Meelis Roos
2006-05-26 10:08           ` YOSHIFUJI Hideaki / 吉藤英明
2006-05-26 10:44             ` Meelis Roos
2006-05-26 11:01               ` YOSHIFUJI Hideaki / 吉藤英明 [this message]
2006-05-26 20:24                 ` [PATCH] [IPV6] ROUTE: Don't try less preferred routes for on-link routes David Miller

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=20060526.200156.83522671.yoshfuji@linux-ipv6.org \
    --to=yoshfuji@linux-ipv6.org \
    --cc=davem@davemloft.net \
    --cc=mroos@linux.ee \
    --cc=netdev@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