[pkg-dhcp-devel] Bug#863402: isc-dhcp-client: fails to configure rfc3442 classless routes on kFreeBSD
Ron
ron at debian.org
Fri May 26 10:32:19 UTC 2017
Package: isc-dhcp-client
Version: 4.3.1-6+deb8u2
Severity: important
Hi,
I thought I'd reported this previously, but I just hit it again (and
apparently I didn't).
In the /etc/dhcp/dhclient-exit-hooks.d/rfc3442-classless-routes script
we do:
if [ "${gateway}" != '0.0.0.0' ]; then
via_arg="gw ${gateway}"
fi
Which means we then try to do something like:
route add -net $network gw $gateway
And that's correct on Linux, but the BSD route(8) on kFreeBSD instead
needs the syntax:
route add -net $network $gateway
Without the "gw" qualifier. It does something very different if that
is included (uses the default gateway address and ignores the 'trailing'
argument with the actual gateway we want.
I can confirm that replacing the above with:
via_arg="${gateway}"
does work as expected on kFreeBSD.
FWIW, I'm actually a little surprised that this line:
/sbin/route add -net "${net_address}/${net_length}" "${via_arg}"
works as intended at all, since the quoting around "${via_arg}" would mean
that "gw $gateway" is passed as a single argument with a literal space
rather than as two arguments. So either I'm tired and missing something,
or route does some 'interesting' parsing of its command line arguments.
We might want to drop the quotes around those, or pass that as in a slightly
different way.
Cheers,
Ron
More information about the pkg-dhcp-devel
mailing list