#927413 src:busybox: busybox-udeb: /etc/udhcpc/default.script assumes a default route from DHCP

Package:
src:busybox
Source:
busybox
Submitter:
Christoph Biedl
Date:
2026-07-26 07:33:01 UTC
Severity:
important
Tags:
#927413#5
Date:
2019-04-19 08:42:12 UTC
From:
To:
Phew,

the udhcpc default.script shipped in in the busybox-udev package
assumes the DHCP server reply contains a default route. If this does
not apply, the code

|       for r in "$router"; do
|           ip -4 route add default via "$r" $onlink
|       done
[ ll.72 ][1]

will run with an empty $route, thus calling ip without a value for the
gateway, causing failure. Since the script is run "-e", further
execution is aborted.

This affects the Debian installer if the DHCP server does not provide a
default route (not needed in an install network if using a proxy).
Since transferring the nameserver information into /etc/resolv.conf
takes place after the above operation, that file is not populated.
Unless there's also a radvd announcing RDNSS records, the installer
will end up with no nameserver information at all, resulting in a prompt
for manual submission, for the name server and possibly some other
information as well. Any netcfg/get_nameservers setting to circumvent
that are ignored, that's something for another day.

Additionally, the above statement will also fail if the DHCP
server provides several default routes, something that is technically
possible.

FWIW, the default.script in the udhcpc package is not affected by these
both issues. It was also inspiration for the patch attached.

    Christoph

[1] https://sources.debian.org/src/busybox/1:1.30.1-4/debian/tree/busybox-udeb/etc/udhcpc/default.script/?hl=73#L72