Bug 181987 - adsl-connect script deletes default route
adsl-connect script deletes default route
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: rp-pppoe (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
Ben Levenson
Depends On:
Blocks: 176344
  Show dependency treegraph
Reported: 2006-02-18 07:46 EST by Bernd Bartmann
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2007-0686
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-07-18 11:11:55 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 Bernd Bartmann 2006-02-18 07:46:27 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.7.12) Gecko/20060202 Fedora/1.0.7-1.2.fc4 Firefox/1.0.7

Description of problem:
If you have two pppoe network interfaces, ifcfg-ppp0 with DEFROUTE="yes" and ifcfg-ppp1 with DEFROUTE="no" the default route is deleted when ppp1 comes up.

The problem lies in the adsl-connect script. Starting at line 257 you'll see this code:

if test "$DEFROUTE" != "no" ; then
    # pppd will no longer delete an existing default route
    # so we have to help it out a little here.
    DEFRT=`ip route list | awk '/^default / { print $3 }'`
    [ -n "${DEFRT}" ] && echo $DEFRT > /etc/default-route
    route del default >/dev/null 2>&1

So if $DEFROUTE as read from the ifcfg-ppp* file is set to "no" it is then
changed to "". The new $DEFROUTE is then used as a parameter for the pppd
command line.

Later in the script starting at line 332:

    if [ "${DEFROUTE}" != "no" ] ; then
        DEFRT=`ip route list | awk '/^default / { print $3 }'`
        [ -n "${DEFRT}" ] && echo $DEFRT > /etc/default-route
        route del default >/dev/null 2>&1

$DEFROUTE is evaluated again but this time it is no longer the value from the
ifcfg-ppp* file but the changed $DEFROUTE. I consider it really bad practice to
change the value of $DEFROUTE in the script. It would be better to use another
variable to construct the value needed for the pppd command line. 

As stated in bug #174641 the issue is fixed in an errata for FC4, but no fix is available yet for RHES4 not even in the Q3 beta.

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

How reproducible:

Steps to Reproduce:
1. ifup ppp0 with DEFROUTE="yes" in ifcfg-ppp0
2. route -n --> default route on ppp0
3. ifup ppp1 with DEFROUTE="no" in ifcfg-ppp1
4. route -n --> now default route is gone

Additional info:
Comment 1 Ngo Than 2006-05-24 06:02:35 EDT
it's fixed in 3.5-22.2.RHEL4.1
Comment 2 RHEL Product and Program Management 2006-08-18 12:37:49 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 9 Red Hat Bugzilla 2007-07-18 11:11:56 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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