[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110901215627.GG1142123@jupiter.n2.diac24.net>
Date: Thu, 1 Sep 2011 23:56:27 +0200
From: David Lamparter <equinox@...c24.net>
To: Jeff Harris <jeff_harris@...trox.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
James Morris <jmorris@...ei.org>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Patrick McHardy <kaber@...sh.net>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: Prefer non link-local source addresses
On Thu, Sep 01, 2011 at 04:20:54PM -0400, Jeff Harris wrote:
> Section 2.6.1 of RFC 3927 specifies that if link-local and routable addresses
> are available on an interface, a routable address is preferred. Update the
> IPv4 source address selection algorithm to use a 169.254.x.x address only if
> another matching address is not found.
> + if (ipv4_is_linklocal_169(ifa->ifa_address)) {
> + lladdr = ifa->ifa_local;
> + continue;
> + }
IP addresses have a scope field:
# ip -4 a l eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
inet 10.0.0.1/24 brd 10.0.0.255 scope link eth0
inet 172.22.80.50/25 brd 172.22.80.127 scope global eth0
would it not make sense to use to use that field instead?
-David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists