public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: David Lamparter <equinox@diac24.net>
To: Jeff Harris <jeff_harris@kentrox.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	James Morris <jmorris@namei.org>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	Patrick McHardy <kaber@trash.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: Prefer non link-local source addresses
Date: Thu, 1 Sep 2011 23:56:27 +0200	[thread overview]
Message-ID: <20110901215627.GG1142123@jupiter.n2.diac24.net> (raw)
In-Reply-To: <1314908454-14359-1-git-send-email-jeff_harris@kentrox.com>

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

  reply	other threads:[~2011-09-01 21:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-01 20:20 [PATCH] net: Prefer non link-local source addresses Jeff Harris
2011-09-01 21:56 ` David Lamparter [this message]
2011-09-01 22:14 ` Julian Anastasov
2011-09-06 15:12   ` Harris, Jeff
2011-09-06 19:48     ` Julian Anastasov

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=20110901215627.GG1142123@jupiter.n2.diac24.net \
    --to=equinox@diac24.net \
    --cc=davem@davemloft.net \
    --cc=jeff_harris@kentrox.com \
    --cc=jmorris@namei.org \
    --cc=kaber@trash.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --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