Bug 11603 - typo in init.d/network
typo in init.d/network
Status: CLOSED DUPLICATE of bug 11591
Product: Red Hat Raw Hide
Classification: Retired
Component: initscripts (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Depends On:
  Show dependency treegraph
Reported: 2000-05-23 10:54 EDT by Michael Tokarev
Modified: 2014-03-16 22:13 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-05-31 17:18:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Michael Tokarev 2000-05-23 10:54:33 EDT
Around line:
 # Add non interface-specific static-routes.
  [ "${gateway}" != "${gateway##[0-9}" ] && \
    /sbin/route add -$type $dest $netmask $mask $gw $gateway

At least, should be "${gateway##[0-9]}" (note closing ]).
But again -- what's this crap for?  Why we should ignore
all routes in form where last component (gateway?) not
ended by digit?  And why ever lines for "any" interface should
contain gateway?  E.g., I want to put there:

  any -net netmask reject
  any -net netmask reject

and in this case, $gateway will be just empty, and those lines
will be ignored (if typo will be corrected).

Maybe this should be "${gateway}" = "${gateway##[0-9]}" (note
change `!=' to `=') ?  I.e. ignore all routes what _does_
contains digits at the end, to be processed by ifup-routes?
Comment 1 Michael Tokarev 2000-05-26 08:13:59 EDT
*** This bug has been marked as a duplicate of 11591 ***
Comment 2 Michael Tokarev 2000-05-30 14:52:59 EDT
Huh, as I noted, this whole thing looks strange.
And it won't work with _host_ routes, where there
is no netmask part.  Consider:

 any host gw

With this,

So, the conclusion I see should be to remove this test completely.
The same is for ifup-post.

And also, why /etc/sysconfig/static-routes is not
installed with initscripts?  It should probably contain
examples (comments) and format ("columns") description at least...
Comment 3 Bill Nottingham 2000-05-31 17:18:30 EDT
OK, that code was put in there to work around the fact
that linuxconf writes:

any net netmask gw eth0
(where the ''gw'' parameter is bogus.)

However, as you mentioned, this test is broken.

It needs to be something along the lines of:

grep "^any" /etc/sysconfig/static-routes | while read ignore type
de$              if [ "${bogus}" = "gw" ]; then
       /sbin/route add -$type $dest $netmask $mask $args
       /sbin/route add -$type $dest $netmask $mask $bogus $args

ifup-post doesn''t contain any static route lines.
Comment 4 Bill Nottingham 2000-05-31 17:20:14 EDT
(feh, that should read:

while read ignore type dest netmask mask bogus args)
Comment 5 Michael Tokarev 2000-06-01 14:36:32 EDT
Would it be better to fix linuxconf instead?!
That's a funny practice -- after this, we will need
to incorporate some linuxconf/etc workarounds into
kernel some day... :)

BTW, I mean ifup-routes instead of ifup-post.
And there is also some funnies of the same sort:

grep "^$1 " /etc/sysconfig/static-routes | while read device args; do
   /sbin/route add -$args $device
grep "^any " /etc/sysconfig/static-routes | \
  while read ignore type net netmask mask bogus dev ; do
    if [ "$dev" = "$device" ]; then
       /sbin/route add -$type $net $netmask $mask $dev

I guess that the second block should be deleted also
(with linuxconf fixed)

Huh, why Bugzilla have no "VERIFIED, but issues still exists"
state? :)
Maybe it should be reopened as linuxconf bug (if there is no such already)?

Note You need to log in before you can comment on or make changes to this bug.