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

system/3747: dhclient-script can't set default route to interface



>Number:         3747
>Category:       system
>Synopsis:       dhclient-script can't set default route to interface
>Confidential:   yes
>Severity:       non-critical
>Priority:       medium
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 14 18:50:01 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Basterfield
>Release:        OpenBSD 3.5
>Organization:
net
>Environment:
	
	System      : OpenBSD 3.5
	Architecture: OpenBSD.sparc64
	Machine     : sparc64
>Description:

While getting my ADSL router to run in half-bridge mode I was unable to get a
working default route from the firmware's dhcp server. The firmware was
giving me a default route which was the same as my IP address.

>How-To-Repeat:

Get an ADSL router with Conexant firmware and put it into half-bridge mode
with an OpenBSD box aquiring the public IP.

>Fix:

Index: dhclient-script
===================================================================
RCS file: /cvs/src/sbin/dhclient/dhclient-script,v
retrieving revision 1.1
diff -u -r1.1 dhclient-script
--- dhclient-script	2004/01/18 01:26:20	1.1
+++ dhclient-script	2004/04/14 18:23:20
@@ -74,7 +74,11 @@
 add_new_routes() {
 	route delete default >/dev/null 2>&1
 	for router in $new_routers; do
-		route add default $router >/dev/null 2>&1
+		if [ "$new_ip_address" = "$router" ]; then
+			route add default -iface $router >/dev/null 2>&1
+		else
+			route add default $router >/dev/null 2>&1
+		fi
 		# 2nd and subsequent default routers error out, so explicitly
 		# stop processing the list after the first one.
 		break


>Release-Note:
>Audit-Trail:
>Unformatted: