After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711635 - dhcp: use a library for DHCP client
dhcp: use a library for DHCP client
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: IP and DNS config
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-11-07 21:09 UTC by Pavel Simerda
Modified: 2016-06-08 22:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pavel Simerda 2013-11-07 21:09:28 UTC
We currently support `dhclient` for DHCP using a helper executable program to bridge between a running dhclient instance and NetworkManager. We partially support dhcpcd which is apparently not preferred by the core developers and the plugin lacks important features (e.g. bug #707464 which we keep just for pleasure as noone's working on that anyway). There's a couple of bugs and feature requests related to DHCP in the bugzilla.

In my opinion, it would be much better to use a properly designed and integrated DHCP library that would provide all of the desired functionality. I'm going to track this bug and hopefully find some suitable solution that would be available in addition to `dhclient` and `dhcpcd` until we decide about further steps.
Comment 1 Dan Winship 2013-11-08 13:16:57 UTC
IIRC connman has such a library, though I don't know how much it supports
Comment 2 Pavel Simerda 2013-11-08 15:03:58 UTC
(In reply to comment #1)
> IIRC connman has such a library, though I don't know how much it supports

Yes. I already talked to Daniel, developer of connman, at LinuxCon Europe 2013 in Edinburgh. They are going to isolate their DHCP library from connman, originally on Lennart Poettering's request. That would actually mean NetworkManager could use the same library as connman and systemd-networkd and we could benefit from their testing as well as our own. I'm also trying to get his opinion on Jiří Pírko's libndp.
Comment 3 Dan Williams 2013-11-27 22:48:50 UTC
I'd be happy to add support for a library that could be integrated into the glib mainloop, which maybe the connman library could, and I've seen the flurry of patches for the isolation on the systemd mailing lists.  I guess it remains to be seen whether that library depends on systemd internal helpers or whether it really could be standalone.

If it can't be integrated into the glib mainloop, and if it cannot be separated from systemd internal helpers, then it can't be used by NetworkManager.
Comment 4 Pavel Simerda 2013-11-28 10:43:01 UTC
(In reply to comment #3)
> If it can't be integrated into the glib mainloop

I guess it will, as connman uses glib mainloop.

> and if it cannot be separated
> from systemd

That might be a problem. I contacted the respective people some time ago but I don't have any clear answer. Maybe you can step in with the authority of NetworkManager maintainer. Or maybe you could help peter and me with this:

https://bugs.freedesktop.org/show_bug.cgi?id=71745

> internal helpers, then it can't be used by NetworkManager.

That would be pity, but what can you do except trying to talk to them. I might try to point some people to this very bugzilla ticket.
Comment 5 Pavel Simerda 2013-11-28 10:43:59 UTC
That said, it's currently *them*, not *us* who can decide whether the DHCP library will be used in NetworkManager or not.
Comment 6 Pavel Simerda 2014-02-04 22:23:56 UTC
Update: Still waiting for the libsystemd-dhcp implementation. According to the developers, we should be able to use it outside systemd-networkd.
Comment 7 Odin Hørthe Omdal 2016-06-08 18:33:40 UTC
What is status here?  Is this now the new "internal" DHCP (that I'm having trouble with)?
Comment 8 Thomas Haller 2016-06-08 22:09:31 UTC
The status is, that NetworkManager pulls in source files from systemd upstream and reuses the code from systemd's network library.

Thus, the "internal" DHCP client, is indeed a library (sort of) and it's the library from system.

I say "sort of", because we still wait that libsystemd-network becomes a proper, separately packaged, shared library. That would improve maintainability of the code.

There is also the downside, that using it as a library we cannot drop privileges like dhclient does (at least, dhclient does so with downstream patches). For that reason, it may (or may not) be less secure, and although using an internal client, proper sandboxing of the internal client would be an important(?) follow-up feature.


Anyway, in the wider sense I consider this issue as fixed. Closing.



(PS: if you have troubles with something, please report it as separate issue :) )