2008-08-06 Dan Williams <dcbw@redhat.com>
* libnm-glib/nm-ip4-config.c libnm-glib/nm-ip4-config.h - Add 'routes' property * libnm-util/nm-setting-vpn.c libnm-util/nm-setting-vpn.h - Remove 'routes' property * libnm-util/nm-setting-ip4-config.c libnm-util/nm-setting-ip4-config.h - 'ignore-dhcp-dns' renamed to 'ignore-auto-dns' - Add 'ignore-auto-routes' property - 'routes' exposed over D-Bus is now an array of array of uint (4) to accomodate route metrics - 'routes' exposed in C is now a list of NMSettingIP4Route structures * libnm-util/nm-utils.c libnm-util/nm-utils.h - Add helpers for marshalling IP4 routes * src/NetworkManagerUtils.c - (nm_utils_merge_ip4_config): handle property renames and new route structure * src/NetworkManagerSystem.c - (nm_system_device_set_ip4_route, nm_system_device_set_from_ip4_config, nm_system_vpn_device_set_from_ip4_config): respect route metrics * src/dhcp-manager/nm-dhcp-manager.c - (nm_dhcp_manager_get_ip4_config): handle new route structure * system-settings/plugins/ifcfg-fedora/reader.c system-settings/plugins/ifcfg-fedora/writer.c - Handle routes separately from addresses now that routes have a different format * introspection/nm-ip4-config.xml src/nm-ip4-config.c src/nm-ip4-config.h - Rename internal routing functions - 'static-routes' renamed to 'routes' git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3898 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -278,11 +278,14 @@ nm_utils_merge_ip4_config (NMIP4Config *ip4_config, NMSettingIP4Config *setting)
|
||||
if (!setting)
|
||||
return; /* Defaults are just fine */
|
||||
|
||||
if (setting->ignore_dhcp_dns) {
|
||||
if (setting->ignore_auto_dns) {
|
||||
nm_ip4_config_reset_nameservers (ip4_config);
|
||||
nm_ip4_config_reset_searches (ip4_config);
|
||||
}
|
||||
|
||||
if (setting->ignore_auto_routes)
|
||||
nm_ip4_config_reset_routes (ip4_config);
|
||||
|
||||
if (setting->dns) {
|
||||
int i, j;
|
||||
|
||||
@@ -344,25 +347,27 @@ nm_utils_merge_ip4_config (NMIP4Config *ip4_config, NMSettingIP4Config *setting)
|
||||
nm_ip4_config_add_address (ip4_config, setting_addr);
|
||||
}
|
||||
|
||||
/* IPv4 static routes */
|
||||
/* IPv4 routes */
|
||||
for (iter = setting->routes; iter; iter = g_slist_next (iter)) {
|
||||
NMSettingIP4Address *setting_route = (NMSettingIP4Address *) iter->data;
|
||||
NMSettingIP4Route *setting_route = (NMSettingIP4Route *) iter->data;
|
||||
guint32 i, num;
|
||||
|
||||
num = nm_ip4_config_get_num_static_routes (ip4_config);
|
||||
num = nm_ip4_config_get_num_routes (ip4_config);
|
||||
for (i = 0; i < num; i++) {
|
||||
const NMSettingIP4Address *cfg_route;
|
||||
const NMSettingIP4Route *cfg_route;
|
||||
|
||||
cfg_route = nm_ip4_config_get_static_route (ip4_config, i);
|
||||
/* Dupe, override with user-specified address */
|
||||
if (cfg_route->address == setting_route->address) {
|
||||
nm_ip4_config_replace_static_route (ip4_config, i, setting_route);
|
||||
cfg_route = nm_ip4_config_get_route (ip4_config, i);
|
||||
/* Dupe, override with user-specified route */
|
||||
if ( (cfg_route->address == setting_route->address)
|
||||
&& (cfg_route->prefix == setting_route->prefix)
|
||||
&& (cfg_route->next_hop == setting_route->next_hop)) {
|
||||
nm_ip4_config_replace_route (ip4_config, i, setting_route);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == num)
|
||||
nm_ip4_config_add_static_route (ip4_config, setting_route);
|
||||
nm_ip4_config_add_route (ip4_config, setting_route);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user