From 3955be817d415773fd085f03bd8c73d1163c60af Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 9 Jul 2024 16:40:58 +0200 Subject: [PATCH] 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 --- src/core/dhcp/nm-dhcp-manager.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/dhcp/nm-dhcp-manager.c b/src/core/dhcp/nm-dhcp-manager.c index cfff23f8d3..68bb327b52 100644 --- a/src/core/dhcp/nm-dhcp-manager.c +++ b/src/core/dhcp/nm-dhcp-manager.c @@ -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; }