mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-21 00:38:30 +02:00
dhcp: improve log message for unknown DHCP plugin
If a DHCP plugin is unknown, the logs says "DHCP client 'x' not available". This is the same message that is shown if, for example, it is a valid DHCP plugin name, but the program is not installed in the system. For example, after 'dhclient' was deprecated, now NM is built without support for it. Then, people with old configs `dhcp=dhclient` get the message "DHCP client 'dhclient' not available". That seems to mean that dhclient is not installed. Show a message "unknown DHCP client" instead. Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/work_items/1917
This commit is contained in:
parent
7f4efc484c
commit
24c50803a7
1 changed files with 3 additions and 1 deletions
|
|
@ -289,8 +289,10 @@ nm_dhcp_manager_init(NMDhcpManager *self)
|
|||
NM_CONFIG_GET_VALUE_STRIP | NM_CONFIG_GET_VALUE_NO_EMPTY);
|
||||
client = client_free;
|
||||
if (client) {
|
||||
client_factory = _client_factory_available(_client_factory_find_by_name(client));
|
||||
client_factory = _client_factory_find_by_name(client);
|
||||
if (!client_factory)
|
||||
_LOGW(AF_UNSPEC, "init: unknown DHCP client '%s', ignoring", client);
|
||||
else if (!(client_factory = _client_factory_available(client_factory)))
|
||||
_LOGW(AF_UNSPEC, "init: DHCP client '%s' not available", client);
|
||||
}
|
||||
if (!client_factory) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue