2008-08-07 Dan Williams <dcbw@redhat.com>

* src/dhcp-manager/nm-dhcp-manager.c
		- (nm_dhcp_manager_get_ip4_config): fix regression which caused
			mis-handling of DHCP responses that returned more than one router
			(found by Grant Williamson)



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3908 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2008-08-07 17:59:16 +00:00
parent 641a7072b8
commit 1fa6715103
2 changed files with 21 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2008-08-07 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): fix regression which caused
mis-handling of DHCP responses that returned more than one router
(found by Grant Williamson)
2008-08-07 Dan Williams <dcbw@redhat.com>
* callouts/nm-dispatcher-action.c

View file

@ -747,9 +747,20 @@ nm_dhcp_manager_get_ip4_config (NMDHCPManager *manager,
}
str = g_hash_table_lookup (device->options, "new_routers");
if (str && (inet_pton (AF_INET, str, &tmp_addr) > 0)) {
addr->gateway = tmp_addr.s_addr;
nm_info(" gateway %s", str);
if (str) {
char **routers = g_strsplit (str, " ", 0);
char **s;
for (s = routers; *s; s++) {
/* FIXME: how to handle multiple routers? */
if (inet_pton (AF_INET, *s, &tmp_addr) > 0) {
addr->gateway = tmp_addr.s_addr;
nm_info (" gateway %s", *s);
break;
} else
nm_warning ("Ignoring invalid gateway '%s'", *s);
}
g_strfreev (routers);
}
nm_ip4_config_take_address (ip4_config, addr);