https://bugzilla.redhat.com/show_bug.cgi?id=1149405
Description of problem:
route(8) fails to add rules in some cases but returns non-error (0).
Version-Release number of selected component (if applicable):
net-tools-2.0-0.15.20131119git.fc20.x86_64
How reproducible:
always.
Steps to Reproduce:
1. route add -net 10.19.207.37 netmask 255.255.255.0 gw <foo>
2.
3.</foo>
Actual results:
route: netmask doesn't match route address
Usage: route ...
(exit status of zero)
Expected results:
Either of:
* route(8) issues the warning (doesn't match route address), but does the
obvious thing and zeros out the net bits in the given addr, and continues
to return no error, OR
* route(8) returns an error status when it won't apply a route, so it is
programmatically detectable by callers
Thanks Conrad, a bugfix [d621c2] is commited to the master.
Related
Commit: [d621c2]
(NB: i chose to fail the operation as this was the intended old behaviour (the problem here is, that usage() no longer returns an error code). While this is not user friendy I can imagine that catching thought errors this way is the safer option.
Thanks Bernd!