Bug 174641 - ADSL script deletes default route
ADSL script deletes default route
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: rp-pppoe (Show other bugs)
4
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-30 19:00 EST by Ferenc Pal
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-17 13:12:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ferenc Pal 2005-11-30 19:00:54 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Description of problem:
Hi Guys
I use 2 adsl connection simultaneously on a linux router running FC4.
I have two  routing tables with default routes in each.
I experienced that the handler script
(probably /sbin/adsl-connect) deletes
default route after a link re-initialisation.
In more details: the default route in the main routing table is set by the ppp0 link-up. The default route in the second table is set by /etc/ppp/ip-up.local (because scripts don't support "secondary" tables and rule-based routing). So the problem is: failure and re-initialisation on the (backup)link ppp1 causes deletion of the default route in the main table. (which belongs to ppp0.)

Version-Release number of selected component (if applicable):
rp-pppoe-3.5-27

How reproducible:
Always

Steps to Reproduce:
1.link failure on ppp1
2. link on ppp1
3. 
  

Actual Results:  deleted default route -> connection lost
even both connections (ppp0, and ppp1 up)

Expected Results:  If DEFROUTE=no is set in /etc/sysconfig/network-scripts/ifcfg-ppp1
scripts should not touch default route set by ppp0 link-up

Additional info:
Comment 1 Bernd Bartmann 2006-02-17 03:53:43 EST
Same problem here. We've debugged this a little further. The problem lies in the
adsl-connect script. Starting at line 257 you'll see this code:

if test "$DEFROUTE" != "no" ; then
    DEFROUTE="defaultroute"
    # 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
else
    DEFROUTE=""
fi

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
    fi

$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. 
Comment 2 Ngo Than 2006-02-17 13:12:14 EST
It's fixed in rp-pppoe-3.5-27.FC4.1 long ago. You should update this new 
package from FC4-update. 
Comment 3 Bernd Bartmann 2006-02-17 13:25:35 EST
You are right for FC4 but the same problem exists in RHES4 and there doesn't
seem to be an errata available yet (not even in the RHES4 Q3 beta channel).

Shall I open a new bug for RHES4?

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