GNOME Bugzilla – Bug 766191
Internal DHCP client can not parse "Domain Name" list (option 15)
Last modified: 2016-05-11 09:19:27 UTC
The "Domain Name" DHCP option 15 is sometimes used to carry a list of domains instead of just one. In such a case it seems to be a common practice to use the list verbatim as a "search" list (e.g., in resolv.conf). While the NetworkManager seems to try to do it's best to cope with the situation in nm-dhcp-systemd.c/lease_to_ip4_config(...): [...] /* Domain Name */ r = sd_dhcp_lease_get_domainname (lease, &str); if (r == 0) { /* Multiple domains sometimes stuffed into the option */ char **domains = g_strsplit (str, " ", 0); char **s; for (s = domains; *s; s++) { [...] , systemd counters by doing it's best to break the things down by returning an "escaped" string out of the sd_dhcp_lease_get_domainname(...). So if you happen to have your DHCP set up to return "mycompany.de mycompany.cz mycompany.com" in the Domain Name field, systemd turns it into "mycompany.de\032mycompany.cz\032mycompany.com" which obviously passes the parser logic intact and gets later used as a domain name.
Created attachment 327538 [details] [review] sd/dhcp: workaround multiple "Domain Name" (option 15) entries https://mail.gnome.org/archives/networkmanager-list/2005-April/msg00022.html https://tools.ietf.org/html/rfc2132#section-3.17
(In reply to Thomas Haller from comment #1) > Created attachment 327538 [details] [review] [review] > sd/dhcp: workaround multiple "Domain Name" (option 15) entries > > https://mail.gnome.org/archives/networkmanager-list/2005-April/msg00022.html > https://tools.ietf.org/html/rfc2132#section-3.17 (untested) :)
I would rather use dns_label_unescape(...) to keep consistent with whatever systemd fabricates next time.
Please disregard my previous comment. It's not that easy. The proposed fix works just fine. Tested with NetworkManager 1.2.0.
patch lgtm
merged. master: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=2e710c2e10174c5b99c85346408d59c9a3ebdbc5 nm-1-2: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=e35d3bfb4143f4fc50a319785ac300b9b0db96e6