netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Haley <brian.haley@hp.com>
To: Jim Westfall <jwestfall@surrealistic.net>
Cc: netdev@vger.kernel.org, YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Subject: Re: ipv6 secondary ips and default ipv6 ip for new outbound	connections
Date: Mon, 21 Mar 2011 22:14:39 -0400	[thread overview]
Message-ID: <4D88060F.2030805@hp.com> (raw)
In-Reply-To: <20110319033507.GY13831@surrealistic.net>

On 03/18/2011 11:35 PM, Jim Westfall wrote:
> Brian Haley <brian.haley@hp.com> wrote [03.18.11]:
>> On 03/18/2011 07:03 PM, Jim Westfall wrote:
>>> Hi
>>>
>>> On ipv4 the first ip added to a nic will be used as the source ip for 
>>> new outbound connections.  Any additional ips, in the same netblock, 
>>> will be added as secondaries.
>>>
>>> ipv6 seems to have the opposite behavior.  The last ipv6 ip added to a 
>>> nic is be used for new outbound connections.

<snip>

>> According to commit 8a6ce0c083f5736e90dabe6d8ce077e7dd0fa35f it's done this
>> way for backward-compatibility - we used to always put new addresses at the
>> front, then we started sorting them by scope.  I couldn't find in the archives
>> who needed the backward-compatible behavior (it was way back in 2006), but
>> Yoshifuji proposed it and I Acked it.
>>
>> You could see if this patch helps you out, but I'm not sure if changing this
>> would break someone else, you'd have to see about putting a knob to control
>> this.
>>
>> -Brian
>>
>> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
>> index 3daaf3c..8c7d5a5 100644
>> --- a/net/ipv6/addrconf.c
>> +++ b/net/ipv6/addrconf.c
>> @@ -577,7 +577,7 @@ ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp)
>>  	list_for_each(p, &idev->addr_list) {
>>  		struct inet6_ifaddr *ifa
>>  			= list_entry(p, struct inet6_ifaddr, if_list);
>> -		if (ifp_scope >= ipv6_addr_src_scope(&ifa->addr))
>> +		if (ifp_scope > ipv6_addr_src_scope(&ifa->addr))
>>  			break;
>>  	}
>>  
> 
> Hi
> 
> Your patch fixes it for me.

Then we need to get Yoshifuji to Ack it since he wanted the previous behavior of
newest-added being first.

-Brian

      parent reply	other threads:[~2011-03-22  2:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 23:03 ipv6 secondary ips and default ipv6 ip for new outbound connections Jim Westfall
2011-03-19  2:23 ` Brian Haley
2011-03-19  3:35   ` Jim Westfall
2011-03-19  8:02     ` Andreas Schwab
2011-03-22  0:15       ` Jim Westfall
2011-03-22  2:14     ` Brian Haley [this message]

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=4D88060F.2030805@hp.com \
    --to=brian.haley@hp.com \
    --cc=jwestfall@surrealistic.net \
    --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;
as well as URLs for NNTP newsgroup(s).