GNOME Bugzilla – Bug 711635
dhcp: use a library for DHCP client
Last modified: 2016-06-08 22:09:31 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.
IIRC connman has such a library, though I don't know how much it supports
(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.
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.
(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.
That said, it's currently *them*, not *us* who can decide whether the DHCP library will be used in NetworkManager or not.
Update: Still waiting for the libsystemd-dhcp implementation. According to the developers, we should be able to use it outside systemd-networkd.
What is status here? Is this now the new "internal" DHCP (that I'm having trouble with)?
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 :) )