Bug 174641 - ADSL script deletes default route
Summary: ADSL script deletes default route
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rp-pppoe
Version: 4
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ngo Than
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-12-01 00:00 UTC by Ferenc Pal
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

(edit)
Clone Of:
(edit)
Last Closed: 2006-02-17 18:12:14 UTC


Attachments (Terms of Use)

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):
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 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
    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 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?


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