summaryrefslogtreecommitdiff
path: root/src/devices
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2015-02-27 16:49:42 +0100
committerLubomir Rintel <lkundrak@v3.sk>2015-02-27 16:50:09 +0100
commitf981407a0235b8dcba88e0f2d97a10c509d3b5ce (patch)
treea8ca1c73d081c63c76c56aa42d90fff8395fc160 /src/devices
parent84f54f0a5f5cc90887aec3357289fe9429da738a (diff)
downloadNetworkManager-lr/route-manager-rh740064.tar.gz
core: pass ifindex as parameter to nm_ip6_config_new()lr/route-manager-rh740064
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/nm-device.c27
-rw-r--r--src/devices/wwan/nm-device-modem.c4
-rw-r--r--src/devices/wwan/nm-modem-broadband.c5
3 files changed, 18 insertions, 18 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index e43db8f351..02c4357499 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -2874,9 +2874,7 @@ ensure_con_ipx_config (NMDevice *self)
return;
priv->con_ip4_config = nm_ip4_config_new (ip_ifindex);
- priv->con_ip6_config = nm_ip6_config_new ();
-
- nm_ip6_config_set_ifindex (priv->con_ip6_config, nm_device_get_ifindex (self));
+ priv->con_ip6_config = nm_ip6_config_new (ip_ifindex);
nm_ip4_config_merge_setting (priv->con_ip4_config,
nm_connection_get_setting_ip4_config (connection),
@@ -3521,8 +3519,7 @@ ip6_config_merge_and_apply (NMDevice *self,
const struct in6_addr *gateway;
/* If no config was passed in, create a new one */
- composite = nm_ip6_config_new ();
- nm_ip6_config_set_ifindex (composite, nm_device_get_ifindex (self));
+ composite = nm_ip6_config_new (nm_device_get_ip_ifindex (self));
ensure_con_ipx_config (self);
g_assert (composite);
@@ -4112,10 +4109,8 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *self)
g_return_if_fail (priv->act_request);
- if (!priv->ac_ip6_config) {
- priv->ac_ip6_config = nm_ip6_config_new ();
- nm_ip6_config_set_ifindex (priv->ac_ip6_config, nm_device_get_ifindex (self));
- }
+ if (!priv->ac_ip6_config)
+ priv->ac_ip6_config = nm_ip6_config_new (nm_device_get_ip_ifindex (self));
if (changed & NM_RDISC_CONFIG_GATEWAYS) {
/* Use the first gateway as ordered in router discovery cache. */
@@ -4619,8 +4614,7 @@ act_stage3_ip6_config_start (NMDevice *self,
ret = linklocal6_start (self);
if (ret == NM_ACT_STAGE_RETURN_SUCCESS) {
/* New blank config; LL address is already in priv->ext_ip6_config */
- *out_config = nm_ip6_config_new ();
- nm_ip6_config_set_ifindex (*out_config, nm_device_get_ifindex (self));
+ *out_config = nm_ip6_config_new (nm_device_get_ip_ifindex (self));
g_assert (*out_config);
}
} else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_DHCP) == 0) {
@@ -4632,8 +4626,7 @@ act_stage3_ip6_config_start (NMDevice *self,
ret = NM_ACT_STAGE_RETURN_POSTPONE;
} else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) == 0) {
/* New blank config */
- *out_config = nm_ip6_config_new ();
- nm_ip6_config_set_ifindex (*out_config, nm_device_get_ifindex (self));
+ *out_config = nm_ip6_config_new (nm_device_get_ip_ifindex (self));
g_assert (*out_config);
ret = NM_ACT_STAGE_RETURN_SUCCESS;
@@ -6042,7 +6035,7 @@ nm_device_set_ip6_config (NMDevice *self,
gboolean has_changes = FALSE;
gboolean success = TRUE;
NMDeviceStateReason reason_local = NM_DEVICE_STATE_REASON_NONE;
- int ip_ifindex;
+ int ip_ifindex, config_ifindex;
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
@@ -6050,6 +6043,12 @@ nm_device_set_ip6_config (NMDevice *self,
ip_iface = nm_device_get_ip_iface (self);
ip_ifindex = nm_device_get_ip_ifindex (self);
+ if (new_config) {
+ config_ifindex = nm_ip6_config_get_ifindex (new_config);
+ if (config_ifindex > 0)
+ g_return_val_if_fail (ip_ifindex == config_ifindex, FALSE);
+ }
+
old_config = priv->ip6_config;
/* Always commit to nm-platform to update lifetimes */
diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
index 9102f5db89..f819d1d774 100644
--- a/src/devices/wwan/nm-device-modem.c
+++ b/src/devices/wwan/nm-device-modem.c
@@ -197,10 +197,8 @@ modem_ip6_config_result (NMModem *modem,
/* Re-enable IPv6 on the interface */
nm_device_ipv6_sysctl_set (device, "disable_ipv6", "0");
- if (config) {
- nm_ip6_config_set_ifindex (config, nm_device_get_ifindex (device));
+ if (config)
nm_device_set_wwan_ip6_config (device, config);
- }
if (do_slaac == FALSE) {
if (got_config)
diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c
index ebd849485f..bf5e246ff8 100644
--- a/src/devices/wwan/nm-modem-broadband.c
+++ b/src/devices/wwan/nm-modem-broadband.c
@@ -800,6 +800,7 @@ stage3_ip6_done (NMModemBroadband *self)
{
GError *error = NULL;
NMIP6Config *config = NULL;
+ const char *data_port;
const gchar *address_string;
NMPlatformIP6Address address;
NMModemIPMethod ip_method;
@@ -837,7 +838,9 @@ stage3_ip6_done (NMModemBroadband *self)
nm_log_info (LOGD_MB, "(%s): IPv6 base configuration:",
nm_modem_get_uid (NM_MODEM (self)));
- config = nm_ip6_config_new ();
+ data_port = mm_bearer_get_interface (self->priv->bearer);
+ g_assert (data_port);
+ config = nm_ip6_config_new (nm_platform_link_get_ifindex (data_port));
address.plen = mm_bearer_ip_config_get_prefix (self->priv->ipv6_config);
nm_ip6_config_add_address (config, &address);