netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukasz Stelmach <stlman@poczta.fm>
To: Lukasz Stelmach <stlman@poczta.fm>
Cc: netdev@vger.kernel.org
Subject: [patch]  ipv6 source address selection in addrconf.c (2.6.17)
Date: Wed, 21 Jun 2006 15:42:11 +0200	[thread overview]
Message-ID: <44994CB3.6070302@poczta.fm> (raw)
In-Reply-To: <44986AE6.6090102@poczta.fm>


[-- Attachment #1.1: Type: text/plain, Size: 1060 bytes --]

Lukasz Stelmach wrote:

> I found it when I was trying to figure out why when trying to connect to
> 
> 2001:200:0:8002:203:47ff:fea5:3085 (www.kame.net)
> 
> with two global addresses assigned to the ethernet card
> 
> fd24:6f44:46bd:face::254
> 2002:531f:d667:face::254
> 
> rule 8 does not work and the first address is chosen.

The answer is that fc00::/7 matches 2001:: better because it gets the same
label (ipv6_saddr_label()). Although fc00::/7 addresses are defined as global
unicast IMHO they should be treated *slightly* different. This is the patch.
Since 6to4 has its own label I have decided to assign one to Teredo too.

However, I still haven't found any clue in referneces to unassigned value of
hiscore.addr_type.

-- 
Było mi bardzo miło.                    Czwarta pospolita klęska, [...]
>Łukasz<                      Już nie katolicka lecz złodziejska.  (c)PP


----------------------------------------------------------------------
Zobacz nowosci salonu moto w Madrycie >>> http://link.interia.pl/f1961

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: addrconf.diff --]
[-- Type: text/x-patch; name="addrconf.diff", Size: 575 bytes --]

--- /usr/src/linux/net/ipv6/addrconf.c~	2006-06-21 11:41:22.000000000 +0200
+++ /usr/src/linux/net/ipv6/addrconf.c	2006-06-21 15:33:26.000000000 +0200
@@ -862,6 +862,8 @@
   * 	2002::/16		2
   * 	::/96			3
   * 	::ffff:0:0/96		4
+  *	fc00::/7		5
+  * 	2001::/32		6
   */
 	if (type & IPV6_ADDR_LOOPBACK)
 		return 0;
@@ -871,6 +873,10 @@
 		return 4;
 	else if (addr->s6_addr16[0] == htons(0x2002))
 		return 2;
+	else if ((addr->s6_addr[0] & 0xfe) == 0xfc)
+		return 5;
+	else if (addr->s6_addr32[0] == htonl(0x20010000))
+		return 6;
 	return 1;
 }
 

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

  reply	other threads:[~2006-06-21 13:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-20 21:38 ipv6 source address selection in addrconf.c (2.6.17) Lukasz Stelmach
2006-06-21 13:42 ` Lukasz Stelmach [this message]
2006-06-21 15:12   ` [patch] " YOSHIFUJI Hideaki / 吉藤英明
2006-06-21 16:05     ` Lukasz Stelmach
2006-06-21 22:57   ` Lukasz Stelmach
2006-06-22  0:26     ` YOSHIFUJI Hideaki / 吉藤英明
2006-06-22 11:04       ` Lukasz Stelmach
2006-06-21 14:02 ` YOSHIFUJI Hideaki / 吉藤英明
     [not found] <20060622.011257.85558580.yoshfuji@linux-ipv6.org>
2006-06-22  8:39 ` [patch] " 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=44994CB3.6070302@poczta.fm \
    --to=stlman@poczta.fm \
    --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;
as well as URLs for NNTP newsgroup(s).