Thread (14 messages) 14 messages, 6 authors, 2010-08-04

Re: [iproute2] iproute2: Allow 'ip addr flush' to loop more than 10 times.

From: Ben Greear <hidden>
Date: 2010-06-29 15:04:45

On 06/29/2010 01:03 AM, Alexander Clouter wrote:
greearb@gmail.com wrote:
quoted
The default remains at 10 for backwards compatibility.

For instance:
# ip addr flush dev eth2
*** Flush remains incomplete after 10 rounds. ***
# ip -l 20 addr flush dev eth2
*** Flush remains incomplete after 20 rounds. ***
# ip -loops 0 addr flush dev eth2
#

This is useful for getting rid of large numbers of IP
addresses in scripts.
Maybe I am missing a trick, but what is wrong with putting this trivial
logic into the script:

ip addr show ${DEV} | awk '/inet6? / { print $2 }' | xargs -I{} ip addr del '{}' dev ${DEV}
This isn't going to be fast if you have thousands of addresses.
You can probably speed things up with '-P' too, '-P 2' gives me a huge
huge speed up for the work I do with 'ip route'.
Where are you using the -P at?  It's not a supported option of 'ip'
as far as I can tell.
Why the need to cram more functionality and options into iproute when
it is something that can be pushed into the wrapper script?
Speed and ease of use.

Thanks,
Ben


-- 
Ben Greear [off-list ref]
Candela Technologies Inc  http://www.candelatech.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help