Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 565108 - >=net-misc/networkmanager-1.0: try to allow the usage of internal dhcp client (neither dhcpcd neither dhclient from dhcp package)
Summary: >=net-misc/networkmanager-1.0: try to allow the usage of internal dhcp client...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://bugzilla.gnome.org/show_bug.c...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-08 06:54 UTC by Constantin Baranov
Modified: 2019-10-19 19:27 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Constantin Baranov 2015-11-08 06:54:21 UTC
Perhaps for historical reasons, networkmanager pulls one of dhcp or dhcpcd packages. Since version 1.0 it has its own internal DHCP client, so none of external clients are required.
Comment 1 Pacho Ramos gentoo-dev 2015-11-10 19:23:29 UTC
You can see in configure.ac that it's not the case, they are still offering support for dhcpcd/dhclient
Comment 2 Constantin Baranov 2015-11-11 03:20:30 UTC
(In reply to Pacho Ramos from comment #1)
> You can see in configure.ac that it's not the case, they are still offering
> support for dhcpcd/dhclient

Correct. But they're not required. I force removed dhclient and NM works happily with its internal DHCP client. My point is that it should be allowed to disable both USE flags.
Comment 3 Pacho Ramos gentoo-dev 2015-11-11 07:38:21 UTC
The configure will try to use dhclient if we try to disable both:
# Fallback
if test "$with_dhclient" = "no" -a "$with_dhcpcd" = "no"; then
	AC_MSG_WARN([Could not find a suitable DHCP client, falling back to dhclient])
	with_dhclient=/sbin/dhclient
fi

http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/configure.ac?h=nm-1-0

:/
Comment 4 Constantin Baranov 2015-11-11 09:36:04 UTC
Indeed. But that's OK. It builds fine with that warning. And at runtime it automatically chooses internal client.
Comment 5 Oleh 2016-03-29 15:24:24 UTC
i've tested internal client and it works quite well (explicitly via dhcp=internal in conf). This is the case for uspstream report.
Comment 6 Mike Gilbert gentoo-dev 2016-05-16 02:50:10 UTC
I can confirm that the internal DHCP client works ok. It can also be manually configured via NetworkManger.conf.

[main]
dhcp=internal
Comment 7 Pacho Ramos gentoo-dev 2016-07-01 09:38:43 UTC
The situation didn't change for 1.2, also, it is done in this way on purpose:
https://bugzilla.gnome.org/show_bug.cgi?id=768205#c1

Then, I am ok with allowing any dhcpcd+dhclient combination (even if I am wondering about completely drop dhcpcd support as it is unmaintained and prone to gain more and more bugs like bug 563938). 

But I am not sure about how to handle the scenario of people trying to disable both (dhcpcd and dhclient) USE flags... as they will lead to a automagic dependency (if /sbin/dhclient is found at buildtime, it will be used, if not... I am unsure if it will fail by default or... :/)

One option would be to try to change:
# Fallback
if test "$with_dhclient" = "no" -a "$with_dhcpcd" = "no"; then
	AC_MSG_WARN([Could not find a suitable DHCP client, falling back to dhclient])
	with_dhclient=/sbin/dhclient
fi

To force it to fail, something like:
# Fallback
if test "$with_dhclient" = "no" -a "$with_dhcpcd" = "no"; then
	AC_MSG_WARN([Could not find a suitable DHCP client, falling back to dhclient])
	with_dhclient=
fi

(or even unset it)

Maybe in that way no dhclient support will be built ever but... what will do then? Can you test (also at runtime) after playing with that "Fallback" part to make it not fallback and let it continue only with the internal dhcp?

Thanks a lot
Comment 8 Matt Turner gentoo-dev 2019-10-19 19:27:22 UTC
It looks like this commit

https://github.com/NetworkManager/NetworkManager/commit/e9bf87805cf968ef4542fefb123384dbf4b5f98c

which is in v1.6.0 enables the internal DHCP client by default if both dhclient and dhcpcd are disabled. I don't see a REQUIRED_USE or anything that forces one of them to be on, and in fact when you disable both NetworkManager's configure prints:

> DHCP clients (default internal):
>   dhcpcanon: no
>   dhclient: no
>   dhcpcd: no

So, marking as fixed.