iproute2/ip
Simon Horman b49240ec7e flush secondary addresses before primary ones
Unless promote_secondaries has been active deleting the primary address of
an interface will automatically delete all the secondary addresses.

In the case where ip flush requests the primary then secondary addresses to
be removed - which is the order the addresses are returned by the kernel -
this will cause an error as by the time the request to remove a secondary
address is made it will be missing as it will have been deleted in the
course of deleting the primary address.

This approach to solving this problem orders requests for the
deletion of secondary addresses before primary ones providing
rtnl_dump_filter_l(), a version of rtnl_dump_filter() that
iterates over a list of filters. And by providing two specialised
filters print_addrinfo_secondary() and print_addrinfo_primary().

rtnl_dump_filter_l() first iterates over all addresses using
print_addrinfo_secondary(), which appends secondary addresses to the
request buffer.  Then again using print_addrinfo_primary() which appends
primary addresses.

This approach should work regardless of it promote_secondaries is
active or not. And regardless of if any primary of secondary addresses
are present or not.

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-12-26 10:11:02 -08:00
..
.gitignore Another .gitignore file. 2006-08-08 12:11:23 -07:00
Makefile support static-only systems 2009-11-10 10:44:20 -08:00
ifcfg Remove trailing whitespace 2006-12-05 10:10:22 -08:00
ip.c Remove Changes: comments 2009-12-01 15:49:48 -08:00
ip6tunnel.c Remove Changes: comments 2009-12-01 15:49:48 -08:00
ip_common.h get rid of warning from misnamed prototype 2008-02-18 10:59:22 -08:00
ipaddress.c flush secondary addresses before primary ones 2009-12-26 10:11:02 -08:00
ipaddrlabel.c Display Correct Error For Addrlabel Info 2008-07-25 13:36:25 -07:00
iplink.c iproute2: Support for the CAN netlink 2009-05-26 15:22:44 -07:00
iplink_can.c iproute2: Support for the CAN netlink 2009-05-26 15:22:44 -07:00
iplink_vlan.c iflink_vlan: support GVRP flag 2008-09-17 21:54:34 -07:00
ipmaddr.c ip maddr show” on an infiniband address causes a stack corruption 2009-01-06 18:56:03 -08:00
ipmonitor.c iproute2: drop equalize support. 2009-03-27 11:11:12 -07:00
ipmroute.c iproute: "ip mroute show" doesn't show all output interfaces 2009-12-01 16:15:15 -08:00
ipneigh.c Remove Changes: comments 2009-12-01 15:49:48 -08:00
ipntable.c Remove trailing whitespace 2006-12-05 10:10:22 -08:00
ipprefix.c Remove trailing whitespace 2006-12-05 10:10:22 -08:00
iproute.c iproute2 add hoplimit parsing and update usage and documentation 2009-12-01 15:51:44 -08:00
iprule.c Remove Changes: comments 2009-12-01 15:49:48 -08:00
iptunnel.c Remove Changes: comments 2009-12-01 15:49:48 -08:00
ipxfrm.c Consolidate fprintf statements 2009-11-10 09:01:57 -08:00
link_gre.c Fix headers needed for gre 2009-03-24 15:40:54 -07:00
link_veth.c veth.h move to linux/ 2007-12-25 12:38:08 -08:00
routef ip/routef lifesaver 2007-07-10 18:29:20 -07:00
routel (Logical change 1.3) 2004-04-15 20:56:59 +00:00
rtm_map.c (Logical change 1.3) 2004-04-15 20:56:59 +00:00
rtmon.c iproute2: Support IFF_LOWER_UP and IFF_DORMANT 2007-06-19 16:40:40 -07:00
rtpr (Logical change 1.3) 2004-04-15 20:56:59 +00:00
static-syms.c support static-only systems 2009-11-10 10:44:20 -08:00
tunnel.c iproute2: ISATAP potential router list 2009-05-26 15:21:21 -07:00
tunnel.h iproute2: ISATAP potential router list 2009-05-26 15:21:21 -07:00
xfrm.h Fix typo in IPPROTO_DCCP 2009-08-06 14:38:18 -07:00
xfrm_monitor.c ip: xfrm: Fix flush message. 2007-09-05 12:56:51 +01:00
xfrm_policy.c fix problem caused by rtnl_send checks 2008-01-31 21:38:58 -08:00
xfrm_state.c ip: xfrm: Add AEAD support 2008-09-17 22:09:01 -07:00