From: David Ahern <dsa@cumulusnetworks.com>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>,
David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, hannes@redhat.com, nicolas.dichtel@6wind.com
Subject: Re: [PATCH net-next v5] net: ipv6: Make address flushing on ifdown optional
Date: Wed, 14 Oct 2015 10:09:59 -0600 [thread overview]
Message-ID: <561E7E57.2070001@cumulusnetworks.com> (raw)
In-Reply-To: <1444815241.2154853.409816321.48710CD1@webmail.messagingengine.com>
On 10/14/15 3:34 AM, Hannes Frederic Sowa wrote:
> Hello,
>
> On Wed, Oct 14, 2015, at 03:45, David Miller wrote:
>> From: David Ahern <dsa@cumulusnetworks.com>
>> Date: Mon, 12 Oct 2015 09:33:07 -0700
>>
>>> Currently, all ipv6 addresses are flushed when the interface is configured
>>> down, including global, static addresses:
>> ...
>>> Add a new sysctl to make this behavior optional. The new setting defaults to
>>> flush all addresses to maintain backwards compatibility. When the setting is
>>> reset global addresses with no expire times are not flushed:
>> ...
>>> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
>>
>> Here is what I really don't like about these changes: the failure
>> semantics are terrible.
>>
>> If I add an address or a route, and some memory allocation fails, I get
>> a notification and see that my operation did not succeed.
>>
>> But here, my routes can fail to be added during an ifup and all I will
>> get, at best, is a kernel log message.
>>
>> This places a serious disconnect between what the user asked for and
>> making sure he finds out directly that his operation did not really
>> fully succeed.
>>
>> In fact, this failure handling here during ifup leaves the interface in
>> a partially configured state.
>
> Agreed, it would be better.
>
>> There are really two ways to deal with this properly:
>>
>> 1) Propagate the failure back through the notifiers and fail the ifup
>> completely when the addrconf_dst_alloc() fails.
>>
>> 2) On ifdown, stash the objects away somewhere so that memory allocation
>> is not necessary on ifup.
>
> In regard to error propagation I think 2) is the only viable option. I
> don't think why you shouldn't be able to simply remove the ip6_rt_put
> after the ip6_del_rt and keep the dst_entry hanging there and later
> reinsert.
I don't agree with stashing it. IPv4 code does not do that and handling
the stashed routes makes the implementation more complex than needed.
This latest patch makes IPv6 static addresses on par with IPv4,
including error paths. On admin link down IPv4 code removes local and
connected routes. On admin link up they are reinserted. Error paths are
not handled. ie., any memory allocations or insertion failures are
silently ignored.
As for this IPv6 patch the only real failure scenario is ENOMEM in the
dst_alloc.
David
next prev parent reply other threads:[~2015-10-14 16:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-12 16:33 [PATCH net-next v5] net: ipv6: Make address flushing on ifdown optional David Ahern
2015-10-14 1:45 ` David Miller
2015-10-14 9:34 ` Hannes Frederic Sowa
2015-10-14 10:08 ` Nicolas Dichtel
2015-10-14 11:03 ` Hannes Frederic Sowa
2015-10-14 12:18 ` David Miller
2015-10-14 12:14 ` Hannes Frederic Sowa
2015-10-14 13:00 ` David Miller
2015-10-14 16:09 ` David Ahern [this message]
2015-10-15 1:06 ` David Miller
2015-10-15 2:46 ` David Ahern
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=561E7E57.2070001@cumulusnetworks.com \
--to=dsa@cumulusnetworks.com \
--cc=davem@davemloft.net \
--cc=hannes@redhat.com \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
/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).