core/trivial: rename "source" field of addresses and routes
The "source" field of NMPlatformIPRoute (now "rt_source") maps to the protocol field of the route. The source of NMPlatformIPAddress (now "addr_source") has no direct equivalent in the kernel. As their use is different, they should have different names. Also, the name "source" is used all over the place. Hence give the fields a more distinct name.
This commit is contained in:
@@ -700,7 +700,7 @@ nm_dhcp_dhclient_read_lease_ip_configs (const char *iface,
|
||||
|
||||
address.timestamp = now_monotonic_ts;
|
||||
address.lifetime = address.preferred = expiry;
|
||||
address.source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
address.addr_source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
|
||||
ip4 = nm_ip4_config_new (ifindex);
|
||||
nm_ip4_config_add_address (ip4, &address);
|
||||
|
@@ -256,7 +256,7 @@ lease_to_ip4_config (const char *iface,
|
||||
SD_DHCP_OPTION_IP_ADDRESS_LEASE_TIME,
|
||||
end_time);
|
||||
|
||||
address.source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
address.addr_source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
nm_ip4_config_add_address (ip4_config, &address);
|
||||
|
||||
/* DNS Servers */
|
||||
@@ -322,7 +322,7 @@ lease_to_ip4_config (const char *iface,
|
||||
route.gateway = a.s_addr;
|
||||
|
||||
if (route.plen) {
|
||||
route.source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
route.rt_source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
route.metric = default_priority;
|
||||
nm_ip4_config_add_route (ip4_config, &route);
|
||||
|
||||
@@ -740,7 +740,7 @@ lease_to_ip6_config (const char *iface,
|
||||
.timestamp = ts,
|
||||
.lifetime = lft_valid,
|
||||
.preferred = lft_pref,
|
||||
.source = NM_IP_CONFIG_SOURCE_DHCP,
|
||||
.addr_source = NM_IP_CONFIG_SOURCE_DHCP,
|
||||
};
|
||||
|
||||
nm_ip6_config_add_address (ip6_config, &address);
|
||||
|
@@ -84,7 +84,7 @@ ip4_process_dhcpcd_rfc3442_routes (const char *str,
|
||||
route.network = rt_addr;
|
||||
route.plen = rt_cidr;
|
||||
route.gateway = rt_route;
|
||||
route.source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
route.rt_source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
route.metric = priority;
|
||||
nm_ip4_config_add_route (ip4_config, &route);
|
||||
}
|
||||
@@ -192,7 +192,7 @@ ip4_process_dhclient_rfc3442_routes (const char *str,
|
||||
char addr[INET_ADDRSTRLEN];
|
||||
|
||||
/* normal route */
|
||||
route.source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
route.rt_source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
route.metric = priority;
|
||||
nm_ip4_config_add_route (ip4_config, &route);
|
||||
|
||||
@@ -314,7 +314,7 @@ process_classful_routes (GHashTable *options, guint32 priority, NMIP4Config *ip4
|
||||
route.plen = 32;
|
||||
}
|
||||
route.gateway = rt_route;
|
||||
route.source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
route.rt_source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
route.metric = priority;
|
||||
|
||||
nm_ip4_config_add_route (ip4_config, &route);
|
||||
@@ -465,7 +465,7 @@ nm_dhcp_utils_ip4_config_from_options (int ifindex,
|
||||
route.plen = 32;
|
||||
/* this will be a device route if gwaddr is 0 */
|
||||
route.gateway = gwaddr;
|
||||
route.source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
route.rt_source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
route.metric = priority;
|
||||
nm_ip4_config_add_route (ip4_config, &route);
|
||||
nm_log_dbg (LOGD_IP, "adding route for server identifier: %s",
|
||||
@@ -482,7 +482,7 @@ nm_dhcp_utils_ip4_config_from_options (int ifindex,
|
||||
nm_log_info (LOGD_DHCP4, " lease time %u", address.lifetime);
|
||||
}
|
||||
|
||||
address.source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
address.addr_source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
nm_ip4_config_add_address (ip4_config, &address);
|
||||
|
||||
str = g_hash_table_lookup (options, "host_name");
|
||||
@@ -642,7 +642,7 @@ nm_dhcp_utils_ip6_config_from_options (int ifindex,
|
||||
}
|
||||
|
||||
address.address = tmp_addr;
|
||||
address.source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
address.addr_source = NM_IP_CONFIG_SOURCE_DHCP;
|
||||
nm_ip6_config_add_address (ip6_config, &address);
|
||||
nm_log_info (LOGD_DHCP6, " address %s", str);
|
||||
} else if (info_only == FALSE) {
|
||||
|
Reference in New Issue
Block a user