DHCP: Fail link_dhcp_set_routes promotely if no address is assigned from lease (...
authorDaniel Wang <wonderfly@users.noreply.github.com>
Wed, 24 May 2017 12:05:49 +0000 (05:05 -0700)
committerLennart Poettering <lennart@poettering.net>
Wed, 24 May 2017 12:05:49 +0000 (14:05 +0200)
commitb23aec0d6b98bc99998786506a8769e1a1ea1841
treee88ed60169d70b613aa8a96f7f4826a67d3b168b
parenta083537e5d11bce68639c492eda33a7fe997d142
DHCP: Fail link_dhcp_set_routes promotely if no address is assigned from lease (#6009)

Currently the local variable `address` is unintialized if the DHCP lease
doesn't provide a router address (when r == -ENODATA). Thus the
subsequent call to route_scope_from_address will result in accessing an
unintialized variable.

As a matter of fact, sd-dhcp-client ignores DHCP leases without an
address so link_dhcp_set_routes probably will never be called without a
valid address.
src/network/networkd-dhcp4.c