lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50mof7-b9p.ln1@chipmunk.wormnet.eu>
Date:	Tue, 29 Jun 2010 09:03:49 +0100
From:	Alexander Clouter <alex@...riz.org.uk>
To:	netdev@...r.kernel.org
Subject: Re: [iproute2] iproute2:  Allow 'ip addr flush' to loop more than 10 times.

greearb@...il.com wrote:
> 
> 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}

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'.

If you still have addresses on your interface after the above command, 
your looping approach probably would have failed also.

Why the need to cram more functionality and options into iproute when 
it is something that can be pushed into the wrapper script? 

Cheers

-- 
Alexander Clouter
.sigmonster says: Lend money to a bad debtor and he will hate you.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ