aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPreston Brown <pbrown@redhat.com>2002-06-27 17:51:57 +0000
committerPreston Brown <pbrown@redhat.com>2002-06-27 17:51:57 +0000
commit15c4be1555400def1a8adddec32c713e7b17f5f0 (patch)
treec1fe0a853e7a5a02be6a5586d3fd9026c6267641
parente07b340f337d8c03410921166b182e854f684299 (diff)
downloadinitscripts-15c4be1555400def1a8adddec32c713e7b17f5f0.tar
initscripts-15c4be1555400def1a8adddec32c713e7b17f5f0.tar.gz
initscripts-15c4be1555400def1a8adddec32c713e7b17f5f0.tar.bz2
initscripts-15c4be1555400def1a8adddec32c713e7b17f5f0.tar.xz
initscripts-15c4be1555400def1a8adddec32c713e7b17f5f0.zip
handle duplicate default routes better.
-rwxr-xr-xsysconfig/network-scripts/ifup10
-rw-r--r--sysconfig/network-scripts/network-functions1
2 files changed, 11 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 0115310f..ab7f39ed 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -198,6 +198,16 @@ if [ -n "${DYNCONFIG}" ]; then
fi
[ -n "$FWHACK" ] && ipchains -D input -s 0/0 53 -d 0/0 1025:65535 -p udp -j ACCEPT
+
+ # DHCP likes to create duplicate routes. Fix that up.
+ NUMDEFROUTES=`ip -o route | \
+ grep default | \
+ awk '{ nlines++ } END { print nlines }'`
+ if [ "$NUMDEFROUTES" -gt 1 ]; then
+ # remove the default route for the new device (old route wins)
+ ip route del default dev ${DEVICE}
+ fi
+# end dynamic device configuration
else
if [ -z "${IPADDR}" ]; then
# enable device without IP, useful for e.g. PPPoE
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 5ce5fd6c..42384882 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -178,6 +178,7 @@ find_gateway_dev ()
add_default_route ()
{
. /etc/sysconfig/network
+ check_default_route && return 0
find_gateway_dev
if [ "$GATEWAYDEV" != "" -a \
"${GATEWAY}" != "" -a \