From 2e710c2e10174c5b99c85346408d59c9a3ebdbc5 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 9 May 2016 21:44:13 +0200 Subject: [PATCH] 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 https://bugzilla.gnome.org/show_bug.cgi?id=766191 --- src/dhcp-manager/nm-dhcp-systemd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dhcp-manager/nm-dhcp-systemd.c b/src/dhcp-manager/nm-dhcp-systemd.c index d123af57ff..10f03ec962 100644 --- a/src/dhcp-manager/nm-dhcp-systemd.c +++ b/src/dhcp-manager/nm-dhcp-systemd.c @@ -279,8 +279,9 @@ lease_to_ip4_config (const char *iface, /* 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); + /* Multiple domains sometimes stuffed into option 15 "Domain Name". + * As systemd escapes such characters, split them at \\032. */ + char **domains = g_strsplit (str, "\\032", 0); char **s; for (s = domains; *s; s++) {