All of lore.kernel.org
 help / color / mirror / Atom feed
* iproute2: ip -force -batch does not continue on errors
@ 2015-03-17 15:07 Sven-Haegar Koch
  2015-03-17 15:17 ` roopa
  0 siblings, 1 reply; 2+ messages in thread
From: Sven-Haegar Koch @ 2015-03-17 15:07 UTC (permalink / raw)
  To: netdev

Hallo,

Test szenario:

# cat b.txt
route del 1.2.3.0/24 dev eth0
route del 1.2.4.0/24 dev eth0
route del 1.2.5.0/24 dev eth0
route add 1.2.3.0/24 dev eth0

# ip -force -batch b.txt
RTNETLINK answers: No such process

Expectation: The three route del commands may fail if the route does 
not (yet) exist, and then (as I am using -force) the route add gets 
executed.

But instead the batch processing is aborted at the first failing "route 
del" command, forcing me to execute ip once per route del instead of 
using the batchmode.

Tested mainly using iproute2 3.16.0, but the current git tree seems to 
behave mostly the same, except that it only executes anything if I add 
"-f inet" to the commandline, otherwise it rejects the first line with 
'Error: an inet prefix is expected rather than "1.2.3.0/24".'

c'ya
sven-haegar

-- 
Three may keep a secret, if two of them are dead.
- Ben F.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: iproute2: ip -force -batch does not continue on errors
  2015-03-17 15:07 iproute2: ip -force -batch does not continue on errors Sven-Haegar Koch
@ 2015-03-17 15:17 ` roopa
  0 siblings, 0 replies; 2+ messages in thread
From: roopa @ 2015-03-17 15:17 UTC (permalink / raw)
  To: Sven-Haegar Koch; +Cc: netdev

On 3/17/15, 8:07 AM, Sven-Haegar Koch wrote:
> Hallo,
>
> Test szenario:
>
> # cat b.txt
> route del 1.2.3.0/24 dev eth0
> route del 1.2.4.0/24 dev eth0
> route del 1.2.5.0/24 dev eth0
> route add 1.2.3.0/24 dev eth0
>
> # ip -force -batch b.txt
> RTNETLINK answers: No such process
>
> Expectation: The three route del commands may fail if the route does
> not (yet) exist, and then (as I am using -force) the route add gets
> executed.
>
> But instead the batch processing is aborted at the first failing "route
> del" command, forcing me to execute ip once per route del instead of
> using the batchmode.
>
> Tested mainly using iproute2 3.16.0, but the current git tree seems to
> behave mostly the same, except that it only executes anything if I add
> "-f inet" to the commandline, otherwise it rejects the first line with
> 'Error: an inet prefix is expected rather than "1.2.3.0/24".'
>

I have run into this as well, I have a patch that fixes this. Will post 
it today...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-17 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-17 15:07 iproute2: ip -force -batch does not continue on errors Sven-Haegar Koch
2015-03-17 15:17 ` roopa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.