From c90ba62d265223430663da04e5683ddcf0583fba Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 9 Feb 2011 19:13:51 +0000 Subject: Fix an issue with dhcp parameters not specifying a defaultgw and the dhcp is the only interface with gateway as a result the box is left wihtout a default gw. Some sporadic reports have been done on this. --- sbin/dhclient-script | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sbin') diff --git a/sbin/dhclient-script b/sbin/dhclient-script index ee98fa0..aaa8144 100755 --- a/sbin/dhclient-script +++ b/sbin/dhclient-script @@ -184,8 +184,9 @@ add_new_routes() { fi ADDED_ROUTE=no + EXISTSGW=`/bin/ls -l /tmp/*_defaultgw | /usr/bin/wc -l` # Only allow the default route to be overridden if it's on our own interface - if [ -f "/tmp/${interface}_defaultgw" ]; then + if [ -f "/tmp/${interface}_defaultgw" -o $EXISTSGW -eq 0 ]; then $ROUTE delete default for router in $new_routers; do if [ "$new_ip_address" = "$router" ]; then -- cgit v1.1