mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-18 15:42:15 +00:00
dhcp: make sure disabled DHCP clients aren't used (gentoo #330319)
If the client was disabled with --with-dhclient=no or --with-dhcpcd=no, then it's corresponding _PATH will be an empty string. In that case we want to ignore that client completely since it was disabled at build time.
This commit is contained in:
parent
91e90d9d54
commit
c050e036c3
|
@ -265,8 +265,13 @@ get_client_type (const char *client, GError **error)
|
|||
const char *dhclient_path = NULL;
|
||||
const char *dhcpcd_path = NULL;
|
||||
|
||||
dhclient_path = nm_dhcp_dhclient_get_path (DHCLIENT_PATH);
|
||||
dhcpcd_path = nm_dhcp_dhcpcd_get_path (DHCPCD_PATH);
|
||||
/* If a client was disabled at build-time, its *_PATH define will be
|
||||
* an empty string.
|
||||
*/
|
||||
if (DHCLIENT_PATH && strlen (DHCLIENT_PATH))
|
||||
dhclient_path = nm_dhcp_dhclient_get_path (DHCLIENT_PATH);
|
||||
if (DHCPCD_PATH && strlen (DHCPCD_PATH))
|
||||
dhcpcd_path = nm_dhcp_dhcpcd_get_path (DHCPCD_PATH);
|
||||
|
||||
if (!client) {
|
||||
if (dhclient_path)
|
||||
|
|
Loading…
Reference in a new issue