summary refs log tree commit diff
path: root/src/core/dhcp/nm-dhcp-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/dhcp/nm-dhcp-manager.c')
-rw-r--r--src/core/dhcp/nm-dhcp-manager.c35
1 files changed, 6 insertions, 29 deletions
diff --git a/src/core/dhcp/nm-dhcp-manager.c b/src/core/dhcp/nm-dhcp-manager.c
index 68bb327b..9faee84e 100644
--- a/src/core/dhcp/nm-dhcp-manager.c
+++ b/src/core/dhcp/nm-dhcp-manager.c
@@ -91,11 +91,6 @@ static const NMDhcpClientFactory *
 _client_factory_available(const NMDhcpClientFactory *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;
     }
@@ -205,30 +200,10 @@ nm_dhcp_manager_start_client(NMDhcpManager *self, NMDhcpClientConfig *config, GE
 
     client = g_object_new(gtype, NM_DHCP_CLIENT_CONFIG, config, NULL);
 
-    /* unfortunately, our implementations work differently per address-family regarding client-id/DUID.
-     *
-     * - for IPv4, the calling code may determine a client-id (from NM's connection profile).
-     *   If present, it is taken. If not present, the DHCP plugin uses a plugin specific default.
-     *     - for "internal" plugin, the default is just "mac".
-     *     - for "dhclient", we try to get the configuration from dhclient's /etc/dhcp or fallback
-     *       to whatever dhclient uses by default.
-     *   We do it this way, because for dhclient the user may configure a default
-     *   outside of NM, and we want to honor that. Worse, dhclient could be a wapper
-     *   script where the wrapper script overwrites the client-id. We need to distinguish
-     *   between: force a particular client-id and leave it unspecified to whatever dhclient
-     *   wants.
-     *
-     * - for IPv6, the calling code always determines a client-id. It also specifies @enforce_duid,
-     *   to determine whether the given client-id must be used.
-     *     - for "internal" plugin @enforce_duid doesn't matter and the given client-id is
-     *       always used.
-     *     - for "dhclient", @enforce_duid FALSE means to first try to load the DUID from the
-     *       lease file, and only otherwise fallback to the given client-id.
-     *     - other plugins don't support DHCPv6.
-     *   It's done this way, so that existing dhclient setups don't change behavior on upgrade.
+    /* - for IPv4, the calling code may determine a client-id (from NM's connection profile).
+     *   If present, it is taken. If not present, the default is just "mac".
      *
-     * This difference is cumbersome and only exists because of "dhclient" which supports hacking the
-     * default outside of NetworkManager API.
+     * - for IPv6, the calling code always determines a client-id.
      */
 
     if (!nm_dhcp_client_start(client, error))
@@ -289,8 +264,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) {