Subject: Re: PR/22418 dhclient does not always (never?) update default route
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,>
From: None <lacombar@gmail.com>
List: netbsd-bugs
Date: 09/30/2006 00:05:03
The following reply was made to PR bin/22418; it has been noted by GNATS.

From: lacombar@gmail.com
To: gnats-bugs@NetBSD.org
Cc: netbsd-bugs@netbsd.org
Subject: Re: PR/22418 dhclient does not always (never?) update default route
Date: Fri, 29 Sep 2006 16:03:15 -0400

 i encounter this bahaviour when a default route already exist. The
 following patch should correct the problem (at least, it works for
 me):
 
 Index: usr.sbin/dhcp/clientscript/dhclient-script
 ===================================================================
 RCS file: /data/netbsd/cvsroot/src/usr.sbin/dhcp/clientscript/dhclient-script,v
 retrieving revision 1.11
 diff -b -u -r1.11 dhclient-script
 --- usr.sbin/dhcp/clientscript/dhclient-script  23 Sep 2006 22:54:43
 -0000      1.11
 +++ usr.sbin/dhcp/clientscript/dhclient-script  29 Sep 2006 19:46:34 -0000
 @@ -59,6 +59,9 @@
  add_new_routes() {
         for router in $new_routers; do
                 route add default $router
 +               if [ $? -gt 0 ]; then
 +                       route change default $router
 +               fi
         done >/dev/null 2>&1
 
         set -- $new_static_routes