Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Nov 2019 21:44:40 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 241792] dhclient default route not working when given a /32 netmask
Message-ID:  <bug-241792-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D241792

            Bug ID: 241792
           Summary: dhclient default route not working when given a /32
                    netmask
           Product: Base System
           Version: 12.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: sigsys@gmail.com

There's a certain VM where autoconfiguration via DHCP works with Linux but =
not
FreeBSD.  I have no information on how this VM is setup apart that it's hos=
ted
with KVM/QEMU.

The DHCP server sends a lease with a /32 netmask.  This makes adding the
default route fail since it is not reachable via any interface.  Linux's
dhclient-script seem to usually have a special case for that and explicitly
adds an interface route to the router's address.

FreeBSD's dhclient-script has a special case for when the router address is=
 the
same as the leased address, but not when it's a different address that does=
n't
fall in the interface's subnet.

With this change, DHCP just works on this VM:

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

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-241792-227>