Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Oct 2022 08:07:47 +0000
From:      "Dave Cottlehuber" <dch@skunkwerks.at>
To:        freebsd-net <freebsd-net@freebsd.org>
Subject:   PR241792 dhclient trivial fix + MFC request
Message-ID:  <ab162a16-f140-422a-a133-8f1f0d5ed4b0@app.fastmail.com>

next in thread | raw e-mail | index | archive | help
TLDR cloud providers expect FreeBSD to behave like linux, and
assign a default interface route to a /32 lease. Without this,
images start up without a default interface. Very inconvenient.

Index: sbin/dhclient/dhclient-script
===================================================================
--- sbin/dhclient/dhclient-script	(revision 354408)
+++ sbin/dhclient/dhclient-script	(working copy)
@@ -173,6 +173,9 @@
			if [ "$new_ip_address" = "$router" ]; then
				route add default -iface $router >/dev/null 2>&1
			else
+				if [ "$new_subnet_mask" = "255.255.255.255" ]; then
+					route add "$router" -iface "$interface" >/dev/null 2>&1
+				fi
				route add default $router >/dev/null 2>&1
			fi
		fi

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241792 for more details.

Would be great to have this in CURRENT and MFC'd to 13.x and 12.x too if possible.

A+
Dave



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ab162a16-f140-422a-a133-8f1f0d5ed4b0>