aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup
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 /sysconfig/network-scripts/ifup
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.
Diffstat (limited to 'sysconfig/network-scripts/ifup')
-rwxr-xr-xsysconfig/network-scripts/ifup10
1 files changed, 10 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