Commit e0c49d73 authored by Beniamino Galvani's avatar Beniamino Galvani

build: remove check on dhcpcd version number

dhcpcd version 6, the first supporting IPv6, was released more than 5
years ago. Remove all checks on version number and IPv6 support.
parent 9e61ea70
......@@ -10,9 +10,6 @@
/* Define to path of dhcpcd binary */
#mesondefine DHCPCD_PATH
/* Define if dhcpcd supports IPv6 (6.x+) */
#mesondefine DHCPCD_SUPPORTS_IPV6
/* Define to path of dnsmasq binary */
#mesondefine DNSMASQ_PATH
......
......@@ -862,10 +862,6 @@ fi
AC_ARG_WITH([dhcpcd],
AS_HELP_STRING([--with-dhcpcd=yes|no|path], [Enable dhcpcd 4.x support]))
AC_ARG_WITH([dhcpcd-supports-ipv6],
AS_HELP_STRING([--with-dhcpcd-supports-ipv6=yes|no|auto],
[Whether using dhcpcd >= 6.x which has IPv6 support]),
[with_dhcpcd_supports_ipv6=$withval], [with_dhcpcd_supports_ipv6=auto])
if test "$with_dhcpcd" != "no"; then
with_dhcpcd_="$with_dhcpcd"
AC_PATH_PROGS(with_dhcpcd, dhcpcd, no, /sbin:/usr/sbin:/usr/local/sbin)
......@@ -873,36 +869,9 @@ if test "$with_dhcpcd" != "no"; then
if test "$with_dhcpcd_" == yes; then
AC_MSG_WARN([dhcpcd not found, assume path /usr/sbin/dhcpcd])
with_dhcpcd=/usr/sbin/dhcpcd
if test "$with_dhcpcd_supports_ipv6" == auto; then
with_dhcpcd_supports_ipv6=yes
fi
fi
else
if ! $with_dhcpcd --version 2>&1 | grep -q "^dhcpcd [[456789]]\."; then
AC_MSG_WARN([Seems version of dhcpcd $with_dhcpcd is too old, version 4.x or newer is required])
fi
fi
fi
if test "$with_dhcpcd" != "no"; then
if $with_dhcpcd --version 2>&1 | grep -q "^dhcpcd [[6789]]\."; then
if test "$with_dhcpcd_supports_ipv6" == no; then
AC_MSG_WARN([Seems version of dhcpcd $with_dhcpcd supports IPv6, but compiling --with-dhcpcd-supports-ipv6=no])
else
with_dhcpcd_supports_ipv6=yes
fi
else
if test "$with_dhcpcd_supports_ipv6" == yes; then
AC_MSG_WARN([Seems version of dhcpcd $with_dhcpcd does not support IPv6, but compiling --with-dhcpcd-supports-ipv6=yes])
else
with_dhcpcd_supports_ipv6=no
fi
fi
if test "$with_dhcpcd_supports_ipv6" != no; then
AC_DEFINE(DHCPCD_SUPPORTS_IPV6, 1, [Define if dhcpcd supports IPv6 (6.x+)])
fi
else
with_dhcpcd_supports_ipv6=no
fi
if test "$with_dhcpcd" != "no"; then
AC_DEFINE(WITH_DHCPCD, 1, [Define if you have dhcpcd])
AC_SUBST(DHCPCD_PATH, $with_dhcpcd)
......@@ -1380,7 +1349,6 @@ echo "DHCP clients (default $config_dhcp_default):"
echo " dhcpcanon: $with_dhcpcanon"
echo " dhclient: $with_dhclient"
echo " dhcpcd: $with_dhcpcd"
echo " dhcpcd-supports-ipv6: $with_dhcpcd_supports_ipv6"
echo
echo "Miscellaneous:"
......
......@@ -567,29 +567,11 @@ config_h.set10('WITH_DHCLIENT', enable_dhclient)
locations = get_option('dhcpcd')
enable_dhcpcd = (locations != ['no'])
enable_dhcpcd_supports_ipv6 = false
if enable_dhcpcd
dhcpcd = find_program(locations, required: false)
enable_dhcpcd = dhcpcd.found()
if enable_dhcpcd
res = run_command(dhcpcd, '--version').stdout().strip()
dhcpcd_version = res.split(' ')[1]
if not dhcpcd_version.version_compare('> 4')
message('Seems version of dhcpcd ' + dhcpcd.path() + ' is too old, version 4.x or newer is required')
endif
enable_dhcpcd_supports_ipv6 = get_option('dhcpcd_supports_ipv6')
if dhcpcd_version.version_compare('> 6')
if not enable_dhcpcd_supports_ipv6
message('Seems version of dhcpcd ' + dhcpcd.path() + ' supports IPv6, but compiling without IPv6 support.')
endif
else
if enable_dhcpcd_supports_ipv6
message('Seems version of dhcpcd ' + dhcpcd.path() +' does not support IPv6, but compiling with IPv6 support.')
endif
endif
config_h.set('DHCPCD_SUPPORTS_IPV6', enable_dhcpcd_supports_ipv6)
config_h.set_quoted('DHCPCD_PATH', dhcpcd.path())
endif
endif
......@@ -1025,7 +1007,6 @@ if enable_dhcpcd
output += ' ' + dhcpcd.path()
endif
output += '\n'
output += ' dhcpcd-supports-ipv6: ' + enable_dhcpcd_supports_ipv6.to_string() + '\n'
output += '\nMiscellaneous:\n'
output += ' have introspection: ' + enable_introspection.to_string() + '\n'
output += ' build documentation and manpages: ' + enable_docs.to_string() + '\n'
......
......@@ -56,9 +56,8 @@ option('config_dns_rc_manager_default', type: 'combo', choices: ['symlink', 'fil
# dhcp clients
option('dhcpcanon', type: 'array', value: ['dhcpcanon', '/sbin/dhcpcanon', '/usr/sbin/dhcpcanon', '/usr/local/sbin/dhcpcanon', '/usr/bin/dhcpcanon', '/usr/local/bin/dhcpcanon'], description: 'Enable dhcpcanon support (experimental)')
option('dhclient', type: 'array', value: ['dhclient', '/sbin/dhclient', '/usr/sbin/dhclient', '/usr/local/sbin/dhclient'], description: 'Enable dhclient support')
option('dhcpcd', type: 'array', value: ['dhcpcd', '/sbin/dhcpcd', '/usr/sbin/dhcpcd', '/usr/local/sbin/dhcpcd'], description: 'Enable dhcpcd 4.x support')
option('dhcpcd', type: 'array', value: ['dhcpcd', '/sbin/dhcpcd', '/usr/sbin/dhcpcd', '/usr/local/sbin/dhcpcd'], description: 'Enable dhcpcd support')
option('config_dhcp_default', type: 'combo', choices: ['dhcpcanon', 'dhclient', 'dhcpcd', 'internal'], value: 'internal', description: 'Default configuration option for main.dhcp setting, used as fallback if the configuration option is unset')
option('dhcpcd_supports_ipv6', type: 'boolean', value: true, description: 'Whether using dhcpcd >= 6.x which has IPv6 support')
# miscellaneous
option('introspection', type: 'boolean', value: true, description: 'Enable introspection for this build')
......
......@@ -133,13 +133,11 @@ ip4_start (NMDhcpClient *client,
g_ptr_array_add (argv, (gpointer) "-c"); /* Set script file */
g_ptr_array_add (argv, (gpointer) nm_dhcp_helper_path);
#ifdef DHCPCD_SUPPORTS_IPV6
/* IPv4-only for now. NetworkManager knows better than dhcpcd when to
* run IPv6, and dhcpcd's automatic Router Solicitations cause problems
* with devices that don't expect them.
*/
g_ptr_array_add (argv, (gpointer) "-4");
#endif
hostname = nm_dhcp_client_get_hostname (client);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment