core/dhcp-manager: warn if dhclient plugin is requested

It's deprecated. Warn any time it is being considered for loading,
instead of at load time, so that the user gets a warning when they got
the plugin in configuration, even if it's build time disabled.

https://issues.redhat.com/browse/RHEL-24622
This commit is contained in:
Lubomir Rintel 2024-07-09 16:40:58 +02:00
parent bc5d76ca82
commit 3955be817d

View file

@ -90,8 +90,15 @@ _client_factory_find_by_name(const char *name)
static const NMDhcpClientFactory *
_client_factory_available(const NMDhcpClientFactory *client_factory)
{
if (client_factory && (!client_factory->get_path || client_factory->get_path()))
return client_factory;
if (client_factory) {
if (nm_streq(client_factory->name, "dhclient")) {
_LOGW(AF_UNSPEC,
"attempting to used a deprecated DHCP client '%s' ",
client_factory->name);
}
if (!client_factory->get_path || client_factory->get_path())
return client_factory;
}
return NULL;
}