Bug 11603 - typo in init.d/network
Summary: typo in init.d/network
Status: CLOSED DUPLICATE of bug 11591
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: initscripts   
(Show other bugs)
Version: 1.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-05-23 14:54 UTC by Michael Tokarev
Modified: 2014-03-17 02:13 UTC (History)
1 user (show)

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

Attachments (Terms of Use)

Description Michael Tokarev 2000-05-23 14:54:33 UTC
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 12:13:59 UTC
*** This bug has been marked as a duplicate of 11591 ***

Comment 2 Michael Tokarev 2000-05-30 18:52:59 UTC
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 21:18:30 UTC
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 21:20:14 UTC
(feh, that should read:

while read ignore type dest netmask mask bogus args)

Comment 5 Michael Tokarev 2000-06-01 18:36:32 UTC
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.