[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"dhclient patch, testers wanted"



Resend, this time with a subject. Sorry.

In case someone wonders, here's a dhclient.conf file that does not include 
"routers":

  initial-interval 1;
  send host-name "some_name";
  request subnet-mask,
          broadcast-address;

---------- Forwarded message ----------
Hi,

here's a small diff to dhclient. The purpose is to leave the default route
alone if the configuration file, e.g /etc/dhclient.conf, does not include
the "routers" request option.

I'm interested in people testing this so we can see it does not break 
anything. :)

Thanks,
  H.

Index: dhclient-script
===================================================================
RCS file: /cvs/src/sbin/dhclient/dhclient-script,v
retrieving revision 1.6
diff -u -u -r1.6 dhclient-script
--- dhclient-script	6 May 2004 18:22:41 -0000	1.6
+++ dhclient-script	30 Jun 2004 10:02:55 -0000
@@ -58,7 +58,9 @@
 delete_old_routes() {
 	# Delete existing default route. We only allow one, so no need to
 	# process $old_routers list.
-	route delete default >/dev/null 2>&1
+	if [ -n "$new_routers" ]; then
+		route delete default >/dev/null 2>&1
+	fi
 
 	if [ -n "$old_static_routes" ]; then
 		set $old_static_routes
@@ -72,7 +74,9 @@
 }
 
 add_new_routes() {
-	route delete default >/dev/null 2>&1
+	if [ -n "$new_routers" ]; then
+		route delete default >/dev/null 2>&1
+	fi
 	for router in $new_routers; do
 		if [ "$new_ip_address" = "$router" ]; then
 			route add default -iface $router >/dev/null 2>&1