merge: branch 'lr/deprecate-dhclient'

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1988
This commit is contained in:
Lubomir Rintel
2024-07-11 15:46:23 +02:00
10 changed files with 52 additions and 26 deletions

View File

@@ -157,6 +157,7 @@ DISTCHECK_CONFIGURE_FLAGS = \
--with-udev-dir=$$dc_install_base/lib/udev \
--with-wext=no \
--enable-ifcfg-rh \
--with-dhclient=yes \
--enable-ifupdown \
--disable-dependency-tracking \
--disable-autotools-deprecation \

4
NEWS
View File

@@ -8,6 +8,10 @@ subject to change and not guaranteed to be compatible with
the later release.
USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE!
* The support for "dhclient" has been deprecated, not built unless
explicitely enabled, and will be removed in a future release.
The internal DHCP client should be used instead and has been
the default since version 1.20 (1.12 when built with meson).
* Support matching a OVS system interface by MAC address.
* Add a timeout option to connectivity checking.
* Support configuring veth interfaces in nmtui.

View File

@@ -915,18 +915,18 @@ fi
# DHCP client support
AC_ARG_WITH([dhclient],
AS_HELP_STRING([--with-dhclient=yes|no|path], [Enable dhclient support]))
if test "$with_dhclient" != "no"; then
with_dhclient_="$with_dhclient"
AS_HELP_STRING([--with-dhclient=yes|no|path], [Enable dhclient support (deprecated)]),
with_dhclient="$withval",
with_dhclient="no")
if test "$with_dhclient" = yes; then
AC_PATH_PROGS(with_dhclient, dhclient, no, /sbin:/usr/sbin:/usr/local/sbin)
if test "$with_dhclient" = "no"; then
if test "$with_dhclient_" = yes; then
AC_MSG_WARN([dhclient not found, assume path /usr/sbin/dhclient])
with_dhclient=/usr/sbin/dhclient
fi
AC_MSG_WARN([dhclient not found, assume path /usr/sbin/dhclient])
with_dhclient=/usr/sbin/dhclient
fi
fi
if test "$with_dhclient" != "no"; then
AC_MSG_WARN([dhclient is unmaintained and support for it is deprecated])
AC_DEFINE(WITH_DHCLIENT, 1, [Define if you have dhclient])
AC_DEFINE_UNQUOTED(DHCLIENT_PATH, "$with_dhclient", [Define path to dhclient])
else
@@ -1477,7 +1477,7 @@ echo
echo "DHCP clients (default $config_dhcp_default):"
echo " dhcpcanon: $with_dhcpcanon"
echo " dhclient: $with_dhclient"
echo " dhclient: $with_dhclient (deprecated)"
echo " dhcpcd: $with_dhcpcd"
echo

View File

@@ -50,8 +50,10 @@
###############################################################################
%if 0%{?fedora} > 40 || 0%{?rhel} >= 10
%bcond_without meson
%bcond_with dhclient
%else
%bcond_with meson
%bcond_without dhclient
%endif
%bcond_without adsl
%bcond_without bluetooth
@@ -593,7 +595,11 @@ Preferably use nmcli instead.
%endif
-Dnft=%{_sbindir}/nft \
-Diptables=%{_sbindir}/iptables \
%if %{with dhclient}
-Ddhclient=%{_sbindir}/dhclient \
%else
-Ddhclient=no \
%endif
-Ddhcpcanon=no \
-Ddhcpcd=no \
-Dcrypto=gnutls \
@@ -725,7 +731,11 @@ autoreconf --install --force
--enable-static=no \
--with-nft=%{_sbindir}/nft \
--with-iptables=%{_sbindir}/iptables \
%if %{with dhclient}
--with-dhclient=%{_sbindir}/dhclient \
%else
--with-dhclient=no \
%endif
--with-dhcpcd=no \
--with-dhcpcanon=no \
--with-crypto=gnutls \

View File

@@ -226,6 +226,7 @@ if [[ $NO_DIST != 1 ]]; then
-Dlibaudit=yes-disabled-by-default \
-Dpolkit=true \
-Dnm_cloud_setup=true \
-Ddhclient=/usr/sbin/dhclient \
-Dconfig_dhcp_default=internal \
-Dconfig_dns_rc_manager_default=auto \
-Diptables=/usr/sbin/iptables \
@@ -267,6 +268,7 @@ if [[ $NO_DIST != 1 ]]; then
--with-libaudit=yes-disabled-by-default \
--enable-polkit=yes \
--with-nm-cloud-setup=yes \
--with-dhclient=yes \
--with-config-dhcp-default=internal \
--with-config-dns-rc-manager-default=auto \
\

View File

@@ -168,17 +168,16 @@ plugins-=remove-me
<varlistentry>
<term><varname>dhcp</varname></term>
<listitem><para>This key sets up what DHCP client
NetworkManager will use. Allowed values are
<literal>dhclient</literal>, <literal>dhcpcd</literal>, and
<literal>internal</literal>. The <literal>dhclient</literal>
and <literal>dhcpcd</literal> options require the indicated
clients to be installed. The <literal>internal</literal>
option uses a built-in DHCP client which is not currently as
featureful as the external clients.</para>
<para>If this key is missing, it defaults to <literal>&NM_CONFIG_DEFAULT_MAIN_DHCP;</literal>.
If the chosen plugin is not available, clients are looked for
in this order: <literal>dhclient</literal>, <literal>dhcpcd</literal>,
<literal>internal</literal>.</para></listitem>
NetworkManager will use. Allowed values depend on build configuration and
typically include <literal>internal</literal> and <literal>dhcpcd</literal>.
Support for unmaintained <literal>dhclient</literal> client has been deprecated
and disabled by default.</para>
<para>The <literal>internal</literal> client is built-in, while other options
may require an external DHCP client to be installed.</para>
<para>If this key is missing, <literal>&NM_CONFIG_DEFAULT_MAIN_DHCP;</literal>
is used with a fallback to other suppored clients in this order:
<literal>internal</literal>, <literal>dhcpcd</literal>,
<literal>dhclient</literal>.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>no-auto-default</varname></term>

View File

@@ -657,6 +657,9 @@ foreach client : [ 'dhclient', 'dhcpcd', 'dhcpcanon' ]
if (client_enable)
dhcp_summary += (' ' + client_path)
endif
if (client == 'dhclient')
dhcp_summary += ' (deprecated)'
endif
dhcp_summary += '\n'
endforeach

View File

@@ -57,7 +57,7 @@ option('netconfig', type: 'string', value: '', description: 'Enable SUSE netconf
option('config_dns_rc_manager_default', type: 'combo', choices: ['auto', 'symlink', 'file', 'netconfig', 'resolvconf'], value: 'auto', description: 'Configure default value for main.rc-manager setting')
# dhcp clients
option('dhclient', type: 'string', value: '', description: 'Enable dhclient support')
option('dhclient', type: 'string', value: 'no', description: 'Enable dhclient support (deprecated)')
option('dhcpcanon', type: 'string', value: '', description: 'Enable dhcpcanon support (experimental)')
option('dhcpcd', type: 'string', value: '', description: 'Enable dhcpcd support')
option('config_dhcp_default', type: 'combo', choices: ['dhcpcanon', 'dhclient', 'dhcpcd', 'internal', 'nettools'], value: 'internal', description: 'Default configuration option for main.dhcp setting, used as fallback if the configuration option is unset')

View File

@@ -30,18 +30,18 @@ const NMDhcpClientFactory *const _nm_dhcp_manager_factories[6] = {
/* the order here matters, as we will try the plugins in this order to find
* the first available plugin. */
&_nm_dhcp_client_factory_internal,
#if WITH_DHCPCANON
&_nm_dhcp_client_factory_dhcpcanon,
#endif
#if WITH_DHCLIENT
&_nm_dhcp_client_factory_dhclient,
#endif
#if WITH_DHCPCD
&_nm_dhcp_client_factory_dhcpcd,
#endif
&_nm_dhcp_client_factory_internal,
&_nm_dhcp_client_factory_systemd,
&_nm_dhcp_client_factory_nettools,
#if WITH_DHCLIENT
&_nm_dhcp_client_factory_dhclient,
#endif
};
/*****************************************************************************/

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;
}