Bug 106331 - ifup gives error message when no default route is present
Summary: ifup gives error message when no default route is present
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-10-06 00:08 UTC by Nickolai Zeldovich
Modified: 2014-03-17 02:39 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-10-06 05:32:13 UTC
Embargoed:


Attachments (Terms of Use)

Description Nickolai Zeldovich 2003-10-06 00:08:32 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030701

Description of problem:
When no default route is installed, ifup produces an error message because the
variable counting default routes is not initialized.
This patch fixes it (apologies for whitespace-conversion problems
with the diff):

--- ifup        2003/10/04 02:21:57     1.1
+++ ifup        2003/10/04 02:48:12     1.2
@@ -264,7 +264,7 @@
     # DHCP likes to create duplicate routes.  Fix that up.
     NUMDEFROUTES=`ip -o route | \
                   grep "^default" | \
-                  awk '{ nlines++ } END { print nlines }'`
+                  awk 'BEGIN { nlines=0; } { nlines++ } END { print nlines }'`
     if [ -n "$NUMDEFROUTES" -a "$NUMDEFROUTES" -gt 1 ]; then
        # remove the default route for the new device (old route wins)
        ip route del default dev ${DEVICE}



Version-Release number of selected component (if applicable):
initscripts-7.14-1

How reproducible:
Always

Steps to Reproduce:
1.Edit dhclient-script to not install a default route.
2.Bring up a DHCP interface.
    

Additional info:

Comment 1 Bill Nottingham 2003-10-06 05:32:13 UTC
This is fixed in current rawhide initscripts.


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