Bug 174641

Summary: ADSL script deletes default route
Product: [Fedora] Fedora Reporter: Ferenc Pal <feri>
Component: rp-pppoeAssignee: Than Ngo <than>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: bernd.bartmann
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-17 18:12:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Ferenc Pal 2005-12-01 00:00:54 UTC
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):

How reproducible:

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

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 08:53:43 UTC
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
    # 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. 

Comment 2 Than Ngo 2006-02-17 18:12:14 UTC
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 18:25:35 UTC
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?