diff options
author | Jonathan Kang <jonathan121537@gmail.com> | 2017-07-06 16:20:25 +0800 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-07-10 11:55:52 +0200 |
commit | 7200906a6202285a97969fea8dea86d5dce9cddf (patch) | |
tree | 6418e7a5161f37a0e9edb2a1d5d89e3f71ed3935 | |
parent | d8164d57e22db64453bf61eb2895dd58dc1baf8d (diff) | |
download | NetworkManager-7200906a6202285a97969fea8dea86d5dce9cddf.tar.gz |
dhcp/dhclient: improve "interface" statement parsing
In commit d405cfd9089f9552969e6a3e1a1c4550fc3c1695, parsing "interface"
statement is introduced. But it leads to uncommplete parsing of the
"request" entry, if one of the lines in "request" entry is prefixed with
word "interface". For example, the default configuration of openSUSE
distribution:
request subnet-mask, broadcast-address, routers,
rfc3442-classless-static-routes,
interface-mtu, host-name, domain-name, domain-search,
domain-name-servers, nis-domain, nis-servers,
nds-context, nds-servers, nds-tree-name,
netbios-name-servers, netbios-dd-server,
netbios-node-type, netbios-scope, ntp-servers;
Fixes: d405cfd9089f9552969e6a3e1a1c4550fc3c1695
https://bugzilla.opensuse.org/show_bug.cgi?id=1047004
https://mail.gnome.org/archives/networkmanager-list/2017-July/msg00015.html
(cherry picked from commit 3646ed083dda590de1e991915048905b8c784cdd)
-rw-r--r-- | src/dhcp/nm-dhcp-dhclient-utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dhcp/nm-dhcp-dhclient-utils.c b/src/dhcp/nm-dhcp-dhclient-utils.c index 216319b3ca..28c290cf94 100644 --- a/src/dhcp/nm-dhcp-dhclient-utils.c +++ b/src/dhcp/nm-dhcp-dhclient-utils.c @@ -296,7 +296,8 @@ nm_dhcp_dhclient_create_config (const char *interface, continue; if ( !intf[0] - && g_str_has_prefix (p, "interface")) { + && g_str_has_prefix (p, "interface") + && !in_req) { if (read_interface (p, intf, sizeof (intf))) continue; } |