public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Martin Vopatek <vopatek@ingate•com>
To: netdev@vger•kernel.org
Subject: iproute2: ip addr flush fail on many secondary addresses
Date: Wed, 12 Mar 2014 15:45:09 +0100	[thread overview]
Message-ID: <532072F5.4000304@ingate.com> (raw)

Hi!

ip addr flush dev eth0

Returns:
Failed to send flush request: Cannot assign requested address
when I have many (> 62) secondary addresses.

Deletion is handled by ipaddr_flush sending two filters
(secondary/primary) to rtnl_dump_filter_l.

With a lot of addresses rtnl_dump_filter_l calls recvmsg
more than once. However, all filters are traversed for each
recv call, so the primary address will be deleted before
all the secondary addresses have been removed.

Running with stat the primary address is not the last.
ip -stat -stat addr flush dev eth0

Flushing secondary/primary addresses has been addressed before:
b49240ec7eab91418d2f090536bf8cd2205988d6
3bc1c4f29777171b484d36abf673667e3729202b

As mentioned there, trying to remove the remaining secondary
addresses will cause an error as they were auto removed when
deleting the primary.

Workaround:
sysctl -w net.ipv4.conf.all.promote_secondaries=1

Regards, vopatek

                 reply	other threads:[~2014-03-12 14:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=532072F5.4000304@ingate.com \
    --to=vopatek@ingate$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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