From 774484eed6d54bc4035d357c799206e9a32a9c82 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 15 Jan 2025 16:14:04 +0100 Subject: [PATCH 1/3] man: document which DHCP clients are enabled in this build Describe in the NetworkManager.conf man page what DHCP clients the user can set in this build, instead of showing a generic list and letting the user try each one. --- man/NetworkManager.conf.xml | 9 ++++----- man/common.ent.in | 1 + meson.build | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/man/NetworkManager.conf.xml b/man/NetworkManager.conf.xml index ba7bb434dd..5c366423a8 100644 --- a/man/NetworkManager.conf.xml +++ b/man/NetworkManager.conf.xml @@ -167,11 +167,10 @@ plugins-=remove-me dhcp - This key sets up what DHCP client - NetworkManager will use. Allowed values depend on build configuration and - typically include internal and dhcpcd. - Support for unmaintained dhclient client has been deprecated - and disabled by default. + This key sets up what DHCP client NetworkManager will + use. Allowed values depend on build configuration; this version of + NetworkManager was built with support for the following clients: + &NM_DHCP_CLIENTS_ENABLED_TEXT;. The internal client is built-in, while other options may require an external DHCP client to be installed. If this key is missing, &NM_CONFIG_DEFAULT_MAIN_DHCP; diff --git a/man/common.ent.in b/man/common.ent.in index 71a47f42d7..2d17b14676 100644 --- a/man/common.ent.in +++ b/man/common.ent.in @@ -10,3 +10,4 @@ + diff --git a/meson.build b/meson.build index 81d83ce843..f410687810 100644 --- a/meson.build +++ b/meson.build @@ -631,6 +631,7 @@ config_h.set10('WITH_OFONO', enable_ofono) # DHCP client support config_dhcp_default = get_option('config_dhcp_default') config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default) +config_dhcp_clients_enabled = [ 'internal' ] dhcp_summary = '' foreach client : [ 'dhclient', 'dhcpcd' ] client_path = get_option(client) @@ -662,6 +663,7 @@ foreach client : [ 'dhclient', 'dhcpcd' ] dhcp_summary += (' ' + client + ': ' + client_enable.to_string()) if (client_enable) dhcp_summary += (' ' + client_path) + config_dhcp_clients_enabled += client endif if (client == 'dhclient') dhcp_summary += ' (deprecated)' @@ -935,6 +937,7 @@ data_conf.set('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default) data_conf.set('NM_CONFIG_DEFAULT_MAIN_RC_MANAGER', config_dns_rc_manager_default) data_conf.set('NM_CONFIG_DEFAULT_MAIN_MIGRATE_IFCFG_RH_TEXT', config_migrate_ifcfg_rh_default) data_conf.set('NM_CONFIG_DEFAULT_WIFI_BACKEND_TEXT', config_wifi_backend_default) +data_conf.set('NM_DHCP_CLIENTS_ENABLED', ', '.join(config_dhcp_clients_enabled)) data_conf.set('NM_MAJOR_VERSION', nm_major_version) data_conf.set('NM_MICRO_VERSION', nm_micro_version) data_conf.set('NM_MINOR_VERSION', nm_minor_version) From d0330fb9094351ab9d28eef159be02e0adb9f269 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 15 Jan 2025 16:26:24 +0100 Subject: [PATCH 2/3] man: remove sentence about order of DHCP clients The list describing the order of DHCP clients is confusing because it doesn't take into account what clients are disabled at build time. Instead, just show the available clients in the preferred order. --- man/NetworkManager.conf.xml | 4 +--- meson.build | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/man/NetworkManager.conf.xml b/man/NetworkManager.conf.xml index 5c366423a8..8710628783 100644 --- a/man/NetworkManager.conf.xml +++ b/man/NetworkManager.conf.xml @@ -174,9 +174,7 @@ plugins-=remove-me The internal client is built-in, while other options may require an external DHCP client to be installed. If this key is missing, &NM_CONFIG_DEFAULT_MAIN_DHCP; - is used with a fallback to other suppored clients in this order: - internal, dhcpcd, - dhclient. + is used with a fallback to other supported clients. no-auto-default diff --git a/meson.build b/meson.build index f410687810..43fd88c818 100644 --- a/meson.build +++ b/meson.build @@ -633,7 +633,7 @@ config_dhcp_default = get_option('config_dhcp_default') config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default) config_dhcp_clients_enabled = [ 'internal' ] dhcp_summary = '' -foreach client : [ 'dhclient', 'dhcpcd' ] +foreach client : [ 'dhcpcd', 'dhclient' ] client_path = get_option(client) client_enable = (client_path != 'no') if client_enable From 95ac6b71cbe84baa07a47807551b4f2eb3b2efeb Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 15 Jan 2025 16:30:29 +0100 Subject: [PATCH 3/3] man: fix typo --- man/NetworkManager.conf.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/NetworkManager.conf.xml b/man/NetworkManager.conf.xml index 8710628783..70ddea3878 100644 --- a/man/NetworkManager.conf.xml +++ b/man/NetworkManager.conf.xml @@ -357,7 +357,7 @@ no-auto-default=* management mode. This option is about how NetworkManager writes to /etc/resolv.conf, if at all. The default value depends on NetworkManager build - options, and this version of NetworkManager was build with a default of + options, and this version of NetworkManager was built with a default of "&NM_CONFIG_DEFAULT_MAIN_RC_MANAGER;". Regardless of this setting, NetworkManager will always write its version of resolv.conf to its runtime state directory