diff options
author | Anssi Hannula <anssi.hannula@iki.fi> | 2018-04-17 18:12:00 +0300 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-04-17 17:12:00 +0200 |
commit | 223932c786ada7f758a7b7878a6ad2dae0d1e5fb (patch) | |
tree | 905b0e88d14ea46df5e575ececbb8951ffb2b6fe /src/network | |
parent | b1c626f67fac9f29166812c12204bbb0c2d73047 (diff) | |
download | systemd-223932c786ada7f758a7b7878a6ad2dae0d1e5fb.tar.gz |
networkd: fix dhcp4 link without routes not being considered ready (#8728)
The dhcp4 code sets link->dhcp4_configured when dhcp4_route_handler()
has processed the last message.
However, in case UseRoutes=no has been set in the [DHCP] section, or
in case the DHCP server simply sends no routes, link_set_dhcp_routes()
will not send any netlink messages and dhcp4_route_handler() will
therefore never be called.
This causes the link to never reach LINK_STATE_CONFIGURED, and e.g.
systemd-networkd-wait-online will not consider the link as ready.
Fix that by setting link->dhcp4_configured = true and calling
link_check_ready() in dhcp4_address_handler() in case
link_set_dhcp_routes() sent no netlink messages (dhcp4_messages is
zero).
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-dhcp4.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index acd0e68a61..6bab7647d6 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -319,6 +319,11 @@ static int dhcp4_address_handler(sd_netlink *rtnl, sd_netlink_message *m, link_set_dhcp_routes(link); + if (link->dhcp4_messages == 0) { + link->dhcp4_configured = true; + link_check_ready(link); + } + return 1; } |