Bug 106331

Summary: ifup gives error message when no default route is present
Product: [Retired] Red Hat Linux Reporter: Nickolai Zeldovich <kolya>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-10-06 05:32:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.