Commit a31ddcfc authored by Thomas Haller's avatar Thomas Haller

core: merge branch 'th/netns-singleton-rh1440089'

https://bugzilla.redhat.com/show_bug.cgi?id=1440089
parents df537d2e 41148cab
......@@ -1445,6 +1445,8 @@ src_libNetworkManager_la_SOURCES = \
src/nm-connectivity.h \
src/nm-dcb.c \
src/nm-dcb.h \
src/nm-netns.c \
src/nm-netns.h \
src/nm-default-route-manager.c \
src/nm-default-route-manager.h \
src/nm-dhcp4-config.c \
......
......@@ -129,7 +129,7 @@ complete_connection (NMDevice *device,
if (s_adsl && !nm_setting_verify (NM_SETTING (s_adsl), NULL, error))
return FALSE;
nm_utils_complete_generic (NM_PLATFORM_GET,
nm_utils_complete_generic (nm_device_get_platform (device),
connection,
NM_SETTING_ADSL_SETTING_NAME,
existing_connections,
......@@ -273,14 +273,14 @@ pppoe_vcc_config (NMDeviceAdsl *self)
return FALSE;
/* Watch for the 'nas' interface going away */
g_signal_connect (NM_PLATFORM_GET, NM_PLATFORM_SIGNAL_LINK_CHANGED,
g_signal_connect (nm_device_get_platform (device), NM_PLATFORM_SIGNAL_LINK_CHANGED,
G_CALLBACK (link_changed_cb),
self);
_LOGD (LOGD_ADSL, "ATM setup successful");
/* otherwise we're good for stage3 */
nm_platform_link_set_up (NM_PLATFORM_GET, priv->nas_ifindex, NULL);
nm_platform_link_set_up (nm_device_get_platform (device), priv->nas_ifindex, NULL);
return TRUE;
}
......@@ -306,7 +306,7 @@ nas_update_cb (gpointer user_data)
}
g_warn_if_fail (priv->nas_ifindex < 0);
priv->nas_ifindex = nm_platform_link_get_ifindex (NM_PLATFORM_GET, priv->nas_ifname);
priv->nas_ifindex = nm_platform_link_get_ifindex (nm_device_get_platform (device), priv->nas_ifname);
if (priv->nas_ifindex < 0) {
/* Keep waiting for it to appear */
return G_SOURCE_CONTINUE;
......@@ -508,7 +508,7 @@ adsl_cleanup (NMDeviceAdsl *self)
g_clear_object (&priv->ppp_manager);
}
g_signal_handlers_disconnect_by_func (NM_PLATFORM_GET, G_CALLBACK (link_changed_cb), self);
g_signal_handlers_disconnect_by_func (nm_device_get_platform (NM_DEVICE (self)), G_CALLBACK (link_changed_cb), self);
if (priv->brfd >= 0) {
close (priv->brfd);
......@@ -542,7 +542,7 @@ carrier_update_cb (gpointer user_data)
path = g_strdup_printf ("/sys/class/atm/%s/carrier",
NM_ASSERT_VALID_PATH_COMPONENT (nm_device_get_iface (NM_DEVICE (self))));
carrier = (int) nm_platform_sysctl_get_int_checked (NM_PLATFORM_GET, NMP_SYSCTL_PATHID_ABSOLUTE (path), 10, 0, 1, -1);
carrier = (int) nm_platform_sysctl_get_int_checked (nm_device_get_platform (NM_DEVICE (self)), NMP_SYSCTL_PATHID_ABSOLUTE (path), 10, 0, 1, -1);
g_free (path);
if (carrier != -1)
......
......@@ -328,7 +328,7 @@ complete_connection (NMDevice *device,
return FALSE;
}
nm_utils_complete_generic (NM_PLATFORM_GET,
nm_utils_complete_generic (nm_device_get_platform (device),
connection,
NM_SETTING_BLUETOOTH_SETTING_NAME,
existing_connections,
......
......@@ -101,7 +101,7 @@ complete_connection (NMDevice *device,
{
NMSettingBond *s_bond;
nm_utils_complete_generic (NM_PLATFORM_GET,
nm_utils_complete_generic (nm_device_get_platform (device),
connection,
NM_SETTING_BOND_SETTING_NAME,
existing_connections,
......@@ -131,7 +131,7 @@ set_bond_attr (NMDevice *device, NMBondMode mode, const char *attr, const char *
if (!_nm_setting_bond_option_supported (attr, mode))
return FALSE;
ret = nm_platform_sysctl_master_set_option (NM_PLATFORM_GET, ifindex, attr, value);
ret = nm_platform_sysctl_master_set_option (nm_device_get_platform (device), ifindex, attr, value);
if (!ret)
_LOGW (LOGD_PLATFORM, "failed to set bonding attribute '%s' to '%s'", attr, value);
return ret;
......@@ -165,7 +165,7 @@ update_connection (NMDevice *device, NMConnection *connection)
/* Read bond options from sysfs and update the Bond setting to match */
options = nm_setting_bond_get_valid_options (s_bond);
while (options && *options) {
gs_free char *value = nm_platform_sysctl_master_get_option (NM_PLATFORM_GET, ifindex, *options);
gs_free char *value = nm_platform_sysctl_master_get_option (nm_device_get_platform (device), ifindex, *options);
const char *defvalue = nm_setting_bond_get_option_default (s_bond, *options);
char *p;
......@@ -328,7 +328,7 @@ apply_bonding_config (NMDevice *device)
set_bond_attr (device, mode, NM_SETTING_BOND_OPTION_PRIMARY, value ? value : "");
/* ARP targets: clear and initialize the list */
contents = nm_platform_sysctl_master_get_option (NM_PLATFORM_GET, ifindex,
contents = nm_platform_sysctl_master_get_option (nm_device_get_platform (device), ifindex,
NM_SETTING_BOND_OPTION_ARP_IP_TARGET);
set_arp_targets (device, mode, contents, " \n", "-");
value = nm_setting_bond_get_option_by_name (s_bond, NM_SETTING_BOND_OPTION_ARP_IP_TARGET);
......@@ -397,7 +397,7 @@ enslave_slave (NMDevice *device,
if (configure) {
nm_device_take_down (slave, TRUE);
success = nm_platform_link_enslave (NM_PLATFORM_GET,
success = nm_platform_link_enslave (nm_device_get_platform (device),
nm_device_get_ip_ifindex (device),
nm_device_get_ip_ifindex (slave));
nm_device_bring_up (slave, TRUE, &no_firmware);
......@@ -416,7 +416,7 @@ enslave_slave (NMDevice *device,
if (s_bond) {
active = nm_setting_bond_get_option_by_name (s_bond, "active_slave");
if (active && nm_streq0 (active, nm_device_get_iface (slave))) {
nm_platform_sysctl_master_set_option (NM_PLATFORM_GET,
nm_platform_sysctl_master_set_option (nm_device_get_platform (device),
nm_device_get_ifindex (device),
"active_slave",
active);
......@@ -446,7 +446,7 @@ release_slave (NMDevice *device,
*/
address = g_strdup (nm_device_get_hw_address (device));
success = nm_platform_link_release (NM_PLATFORM_GET,
success = nm_platform_link_release (nm_device_get_platform (device),
nm_device_get_ip_ifindex (device),
nm_device_get_ip_ifindex (slave));
......@@ -458,7 +458,7 @@ release_slave (NMDevice *device,
nm_device_get_ip_iface (slave));
}
nm_platform_process_events (NM_PLATFORM_GET);
nm_platform_process_events (nm_device_get_platform (device));
if (nm_device_update_hw_address (device))
nm_device_hw_addr_set (device, address, "restore", FALSE);
......@@ -486,7 +486,7 @@ create_and_realize (NMDevice *device,
g_assert (iface);
plerr = nm_platform_link_bond_add (NM_PLATFORM_GET, iface, out_plink);
plerr = nm_platform_link_bond_add (nm_device_get_platform (device), iface, out_plink);
if (plerr != NM_PLATFORM_ERROR_SUCCESS) {
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
"Failed to create bond interface '%s' for '%s': %s",
......
......@@ -107,7 +107,7 @@ complete_connection (NMDevice *device,
{
NMSettingBridge *s_bridge;
nm_utils_complete_generic (NM_PLATFORM_GET,
nm_utils_complete_generic (nm_device_get_platform (device),
connection,
NM_SETTING_BRIDGE_SETTING_NAME,
existing_connections,
......@@ -197,9 +197,9 @@ commit_option (NMDevice *device, NMSetting *setting, const Option *option, gbool
value = g_strdup_printf ("%u", uval);
if (slave)
nm_platform_sysctl_slave_set_option (NM_PLATFORM_GET, ifindex, option->sysname, value);
nm_platform_sysctl_slave_set_option (nm_device_get_platform (device), ifindex, option->sysname, value);
else
nm_platform_sysctl_master_set_option (NM_PLATFORM_GET, ifindex, option->sysname, value);
nm_platform_sysctl_master_set_option (nm_device_get_platform (device), ifindex, option->sysname, value);
}
static void
......@@ -243,7 +243,7 @@ update_connection (NMDevice *device, NMConnection *connection)
}
for (option = master_options; option->name; option++) {
gs_free char *str = nm_platform_sysctl_master_get_option (NM_PLATFORM_GET, ifindex, option->sysname);
gs_free char *str = nm_platform_sysctl_master_get_option (nm_device_get_platform (device), ifindex, option->sysname);
int value;
if (str) {
......@@ -282,7 +282,7 @@ master_update_slave_connection (NMDevice *device,
}
for (option = slave_options; option->name; option++) {
gs_free char *str = nm_platform_sysctl_slave_get_option (NM_PLATFORM_GET, ifindex_slave, option->sysname);
gs_free char *str = nm_platform_sysctl_slave_get_option (nm_device_get_platform (device), ifindex_slave, option->sysname);
int value;
if (str) {
......@@ -333,7 +333,7 @@ enslave_slave (NMDevice *device,
NMDeviceBridge *self = NM_DEVICE_BRIDGE (device);
if (configure) {
if (!nm_platform_link_enslave (NM_PLATFORM_GET, nm_device_get_ip_ifindex (device), nm_device_get_ip_ifindex (slave)))
if (!nm_platform_link_enslave (nm_device_get_platform (device), nm_device_get_ip_ifindex (device), nm_device_get_ip_ifindex (slave)))
return FALSE;
commit_slave_options (slave, nm_connection_get_setting_bridge_port (connection));
......@@ -357,7 +357,7 @@ release_slave (NMDevice *device,
gboolean success;
if (configure) {
success = nm_platform_link_release (NM_PLATFORM_GET,
success = nm_platform_link_release (nm_device_get_platform (device),
nm_device_get_ip_ifindex (device),
nm_device_get_ip_ifindex (slave));
......@@ -401,7 +401,7 @@ create_and_realize (NMDevice *device,
}
}
plerr = nm_platform_link_bridge_add (NM_PLATFORM_GET,
plerr = nm_platform_link_bridge_add (nm_device_get_platform (device),
iface,
hwaddr ? mac_address : NULL,
hwaddr ? ETH_ALEN : 0,
......
......@@ -62,7 +62,7 @@ complete_connection (NMDevice *device,
{
NMSettingDummy *s_dummy;
nm_utils_complete_generic (NM_PLATFORM_GET,
nm_utils_complete_generic (nm_device_get_platform (device),
connection,
NM_SETTING_DUMMY_SETTING_NAME,
existing_connections,
......@@ -106,7 +106,7 @@ create_and_realize (NMDevice *device,
s_dummy = nm_connection_get_setting_dummy (connection);
g_assert (s_dummy);
plerr = nm_platform_link_dummy_add (NM_PLATFORM_GET, iface, out_plink);
plerr = nm_platform_link_dummy_add (nm_device_get_platform (device), iface, out_plink);
if (plerr != NM_PLATFORM_ERROR_SUCCESS) {
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
"Failed to create dummy interface '%s' for '%s': %s",
......
......@@ -172,7 +172,7 @@ _update_s390_subchannels (NMDeviceEthernet *self)
}
ifindex = nm_device_get_ifindex ((NMDevice *) self);
dev = nm_platform_link_get_udev_device (NM_PLATFORM_GET, ifindex);
dev = nm_platform_link_get_udev_device (nm_device_get_platform (NM_DEVICE (self)), ifindex);
if (!dev)
return;
......@@ -209,7 +209,7 @@ _update_s390_subchannels (NMDeviceEthernet *self)
gs_free char *path = NULL, *value = NULL;
path = g_strdup_printf ("%s/%s", parent_path, item);
value = nm_platform_sysctl_get (NM_PLATFORM_GET, NMP_SYSCTL_PATHID_ABSOLUTE (path));
value = nm_platform_sysctl_get (nm_device_get_platform (NM_DEVICE (self)), NMP_SYSCTL_PATHID_ABSOLUTE (path));
if ( !strcmp (item, "portname")
&& !g_strcmp0 (value, "no portname required")) {
......@@ -304,7 +304,7 @@ get_generic_capabilities (NMDevice *device)
int ifindex = nm_device_get_ifindex (device);
if (ifindex > 0) {
if (nm_platform_link_supports_carrier_detect (NM_PLATFORM_GET, ifindex))
if (nm_platform_link_supports_carrier_detect (nm_device_get_platform (device), ifindex))
return NM_DEVICE_CAP_CARRIER_DETECT;
else {
_LOGI (LOGD_PLATFORM, "driver '%s' does not support carrier detection.",
......@@ -569,7 +569,7 @@ build_supplicant_config (NMDeviceEthernet *self,
connection = nm_device_get_applied_connection (NM_DEVICE (self));
g_assert (connection);
con_uuid = nm_connection_get_uuid (connection);
mtu = nm_platform_link_get_mtu (NM_PLATFORM_GET,
mtu = nm_platform_link_get_mtu (nm_device_get_platform (NM_DEVICE (self)),
nm_device_get_ifindex (NM_DEVICE (self)));
config = nm_supplicant_config_new ();
......@@ -828,7 +828,7 @@ link_negotiation_set (NMDevice *device)
}
}
if (!nm_platform_ethtool_get_link_settings (NM_PLATFORM_GET, nm_device_get_ifindex (device),
if (!nm_platform_ethtool_get_link_settings (nm_device_get_platform (device), nm_device_get_ifindex (device),
&link_autoneg, &link_speed, &link_duplex)) {
_LOGW (LOGD_DEVICE, "set-link: unable to retrieve link negotiation");
return;
......@@ -852,7 +852,7 @@ link_negotiation_set (NMDevice *device)
duplex ? "" : "*");
}
if (!nm_platform_ethtool_set_link_settings (NM_PLATFORM_GET,
if (!nm_platform_ethtool_set_link_settings (nm_device_get_platform (device),
nm_device_get_ifindex (device),
autoneg,
speed,
......@@ -1124,7 +1124,7 @@ dcb_state (NMDevice *device, gboolean timeout)
g_return_if_fail (nm_device_get_state (device) == NM_DEVICE_STATE_CONFIG);
carrier = nm_platform_link_is_connected (NM_PLATFORM_GET, nm_device_get_ifindex (device));
carrier = nm_platform_link_is_connected (nm_device_get_platform (device), nm_device_get_ifindex (device));
_LOGD (LOGD_DCB, "dcb_state() wait %d carrier %d timeout %d", priv->dcb_wait, carrier, timeout);
switch (priv->dcb_wait) {
......@@ -1242,7 +1242,7 @@ wake_on_lan_enable (NMDevice *device)
}
wol = NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE;
found:
return nm_platform_ethtool_set_wake_on_lan (NM_PLATFORM_GET, nm_device_get_ifindex (device), wol, password);
return nm_platform_ethtool_set_wake_on_lan (nm_device_get_platform (device), nm_device_get_ifindex (device), wol, password);
}
/*****************************************************************************/
......@@ -1285,7 +1285,7 @@ act_stage2_config (NMDevice *device, NMDeviceStateReason *out_failure_reason)
s_dcb = (NMSettingDcb *) nm_device_get_applied_setting (device, NM_TYPE_SETTING_DCB);
if (s_dcb) {
/* lldpad really really wants the carrier to be up */
if (nm_platform_link_is_connected (NM_PLATFORM_GET, nm_device_get_ifindex (device))) {
if (nm_platform_link_is_connected (nm_device_get_platform (device), nm_device_get_ifindex (device))) {
if (!dcb_enable (device)) {
NM_SET_OUT (out_failure_reason, NM_DEVICE_STATE_REASON_DCB_FCOE_FAILED);
return NM_ACT_STAGE_RETURN_FAILURE;
......@@ -1321,7 +1321,7 @@ act_stage2_config (NMDevice *device, NMDeviceStateReason *out_failure_reason)
if (mxu) {
_LOGD (LOGD_PPP, "set MTU to %u (PPP interface MRU %u, MTU %u)",
mxu + PPPOE_ENCAP_OVERHEAD, mru, mtu);
nm_platform_link_set_mtu (NM_PLATFORM_GET,
nm_platform_link_set_mtu (nm_device_get_platform (device),
nm_device_get_ifindex (device),
mxu + PPPOE_ENCAP_OVERHEAD);
}
......@@ -1427,7 +1427,7 @@ complete_connection (NMDevice *device,
/* Default to an ethernet-only connection, but if a PPPoE setting was given
* then PPPoE should be our connection type.
*/
nm_utils_complete_generic (NM_PLATFORM_GET,
nm_utils_complete_generic (nm_device_get_platform (device),
connection,
s_pppoe ? NM_SETTING_PPPOE_SETTING_NAME : NM_SETTING_WIRED_SETTING_NAME,
existing_connections,
......@@ -1585,7 +1585,7 @@ get_link_speed (NMDevice *device)
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self);
guint32 speed;
if (!nm_platform_ethtool_get_link_settings (NM_PLATFORM_GET, nm_device_get_ifindex (device), NULL, &speed, NULL))
if (!nm_platform_ethtool_get_link_settings (nm_device_get_platform (device), nm_device_get_ifindex (device), NULL, &speed, NULL))
return;
if (priv->speed == speed)
return;
......
......@@ -54,11 +54,11 @@ G_DEFINE_TYPE (NMDeviceGeneric, nm_device_generic, NM_TYPE_DEVICE)
/*****************************************************************************/
static NMDeviceCapabilities
get_generic_capabilities (NMDevice *dev)
get_generic_capabilities (NMDevice *device)
{
int ifindex = nm_device_get_ifindex (dev);
int ifindex = nm_device_get_ifindex (device);
if (ifindex > 0 && nm_platform_link_supports_carrier_detect (NM_PLATFORM_GET, ifindex))
if (ifindex > 0 && nm_platform_link_supports_carrier_detect (nm_device_get_platform (device), ifindex))
return NM_DEVICE_CAP_CARRIER_DETECT;
else
return NM_DEVICE_CAP_NONE;
......@@ -84,7 +84,7 @@ realize_start_notify (NMDevice *device, const NMPlatformLink *plink)
g_clear_pointer (&priv->type_description, g_free);
ifindex = nm_device_get_ip_ifindex (NM_DEVICE (self));
if (ifindex > 0)
priv->type_description = g_strdup (nm_platform_link_get_type_name (NM_PLATFORM_GET, ifindex));
priv->type_description = g_strdup (nm_platform_link_get_type_name (nm_device_get_platform (device), ifindex));
}
static gboolean
......
......@@ -75,7 +75,7 @@ get_generic_capabilities (NMDevice *device)
}
static NMActStageReturn
act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *out_failure_reason)
act_stage1_prepare (NMDevice *device, NMDeviceStateReason *out_failure_reason)
{
nm_auto_close int dirfd = -1;
NMActStageReturn ret;
......@@ -84,16 +84,16 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *out_failure_reason)
const char *transport_mode;
gboolean ok, no_firmware = FALSE;
ret = NM_DEVICE_CLASS (nm_device_infiniband_parent_class)->act_stage1_prepare (dev, out_failure_reason);
ret = NM_DEVICE_CLASS (nm_device_infiniband_parent_class)->act_stage1_prepare (device, out_failure_reason);
if (ret != NM_ACT_STAGE_RETURN_SUCCESS)
return ret;
s_infiniband = (NMSettingInfiniband *) nm_device_get_applied_setting (dev, NM_TYPE_SETTING_INFINIBAND);
s_infiniband = (NMSettingInfiniband *) nm_device_get_applied_setting (device, NM_TYPE_SETTING_INFINIBAND);
g_return_val_if_fail (s_infiniband, NM_ACT_STAGE_RETURN_FAILURE);
transport_mode = nm_setting_infiniband_get_transport_mode (s_infiniband);
dirfd = nm_platform_sysctl_open_netdir (NM_PLATFORM_GET, nm_device_get_ifindex (dev), ifname_verified);
dirfd = nm_platform_sysctl_open_netdir (nm_device_get_platform (device), nm_device_get_ifindex (device), ifname_verified);
if (dirfd < 0) {
if (!strcmp (transport_mode, "datagram"))
return NM_ACT_STAGE_RETURN_SUCCESS;
......@@ -104,9 +104,9 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *out_failure_reason)
}
/* With some drivers the interface must be down to set transport mode */
nm_device_take_down (dev, TRUE);
ok = nm_platform_sysctl_set (NM_PLATFORM_GET, NMP_SYSCTL_PATHID_NETDIR (dirfd, ifname_verified, "mode"), transport_mode);
nm_device_bring_up (dev, TRUE, &no_firmware);
nm_device_take_down (device, TRUE);
ok = nm_platform_sysctl_set (nm_device_get_platform (device), NMP_SYSCTL_PATHID_NETDIR (dirfd, ifname_verified, "mode"), transport_mode);
nm_device_bring_up (device, TRUE, &no_firmware);
if (!ok) {
NM_SET_OUT (out_failure_reason, NM_DEVICE_STATE_REASON_CONFIG_FAILED);
......@@ -184,7 +184,7 @@ complete_connection (NMDevice *device,
const char *setting_mac;
const char *hw_address;
nm_utils_complete_generic (NM_PLATFORM_GET,
nm_utils_complete_generic (nm_device_get_platform (device),
connection,
NM_SETTING_INFINIBAND_SETTING_NAME,
existing_connections,
......@@ -240,7 +240,7 @@ update_connection (NMDevice *device, NMConnection *connection)
ifindex = nm_device_get_ifindex (device);
if (ifindex > 0) {
if (!nm_platform_link_infiniband_get_properties (NM_PLATFORM_GET, ifindex, NULL, NULL, &transport_mode))
if (!nm_platform_link_infiniband_get_properties (nm_device_get_platform (device), ifindex, NULL, NULL, &transport_mode))
transport_mode = "datagram";
}
g_object_set (G_OBJECT (s_infiniband), NM_SETTING_INFINIBAND_TRANSPORT_MODE, transport_mode, NULL);
......@@ -289,7 +289,7 @@ create_and_realize (NMDevice *device,
return FALSE;
}
plerr = nm_platform_link_infiniband_add (NM_PLATFORM_GET, priv->parent_ifindex, priv->p_key, out_plink);
plerr = nm_platform_link_infiniband_add (nm_device_get_platform (device), priv->parent_ifindex, priv->p_key, out_plink);
if (plerr != NM_PLATFORM_ERROR_SUCCESS) {
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
"Failed to create InfiniBand P_Key interface '%s' for '%s': %s",
......@@ -319,7 +319,7 @@ unrealize (NMDevice *device, GError **error)
return FALSE;
}
plerr = nm_platform_link_infiniband_delete (NM_PLATFORM_GET, priv->parent_ifindex, priv->p_key);
plerr = nm_platform_link_infiniband_delete (nm_device_get_platform (device), priv->parent_ifindex, priv->p_key);
if (plerr != NM_PLATFORM_ERROR_SUCCESS) {
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
"Failed to remove InfiniBand P_Key interface '%s': %s",
......
......@@ -157,7 +157,7 @@ clear:
if (priv->mode == NM_IP_TUNNEL_MODE_GRE) {
const NMPlatformLnkGre *lnk;
lnk = nm_platform_link_get_lnk_gre (NM_PLATFORM_GET, ifindex, NULL);
lnk = nm_platform_link_get_lnk_gre (nm_device_get_platform (device), ifindex, NULL);
if (!lnk) {
_LOGW (LOGD_PLATFORM, "could not read %s properties", "gre");
goto clear;
......@@ -202,7 +202,7 @@ clear:
} else if (priv->mode == NM_IP_TUNNEL_MODE_SIT) {
const NMPlatformLnkSit *lnk;
lnk = nm_platform_link_get_lnk_sit (NM_PLATFORM_GET, ifindex, NULL);
lnk = nm_platform_link_get_lnk_sit (nm_device_get_platform (device), ifindex, NULL);
if (!lnk) {
_LOGW (LOGD_PLATFORM, "could not read %s properties", "sit");
goto clear;
......@@ -217,7 +217,7 @@ clear:
} else if (priv->mode == NM_IP_TUNNEL_MODE_IPIP) {
const NMPlatformLnkIpIp *lnk;
lnk = nm_platform_link_get_lnk_ipip (NM_PLATFORM_GET, ifindex, NULL);
lnk = nm_platform_link_get_lnk_ipip (nm_device_get_platform (device), ifindex, NULL);
if (!lnk) {
_LOGW (LOGD_PLATFORM, "could not read %s properties", "ipip");
goto clear;
......@@ -233,7 +233,7 @@ clear:
|| priv->mode == NM_IP_TUNNEL_MODE_IP6IP6) {
const NMPlatformLnkIp6Tnl *lnk;
lnk = nm_platform_link_get_lnk_ip6tnl (NM_PLATFORM_GET, ifindex, NULL);
lnk = nm_platform_link_get_lnk_ip6tnl (nm_device_get_platform (device), ifindex, NULL);
if (!lnk) {
_LOGW (LOGD_PLATFORM, "could not read %s properties", "ip6tnl");
goto clear;
......@@ -332,7 +332,7 @@ complete_connection (NMDevice *device,
{
NMSettingIPTunnel *s_ip_tunnel;
nm_utils_complete_generic (NM_PLATFORM_GET,
nm_utils_complete_generic (nm_device_get_platform (device),
connection,
NM_SETTING_IP_TUNNEL_SETTING_NAME,
existing_connections,
......@@ -641,7 +641,7 @@ create_and_realize (NMDevice *device,
lnk_gre.output_flags = NM_GRE_KEY;
}
plerr = nm_platform_link_gre_add (NM_PLATFORM_GET, iface, &lnk_gre, out_plink);
plerr = nm_platform_link_gre_add (nm_device_get_platform (device), iface, &lnk_gre, out_plink);
if (plerr != NM_PLATFORM_ERROR_SUCCESS) {
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
"Failed to create GRE interface '%s' for '%s': %s",
......@@ -667,7 +667,7 @@ create_and_realize (NMDevice *device,
lnk_sit.tos = nm_setting_ip_tunnel_get_tos (s_ip_tunnel);
lnk_sit.path_mtu_discovery = nm_setting_ip_tunnel_get_path_mtu_discovery (s_ip_tunnel);
plerr = nm_platform_link_sit_add (NM_PLATFORM_GET, iface, &lnk_sit, out_plink);
plerr = nm_platform_link_sit_add (nm_device_get_platform (device), iface, &lnk_sit, out_plink);
if (plerr != NM_PLATFORM_ERROR_SUCCESS) {
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
"Failed to create SIT interface '%s' for '%s': %s",
......@@ -693,7 +693,7 @@ create_and_realize (NMDevice *device,
lnk_ipip.tos = nm_setting_ip_tunnel_get_tos (s_ip_tunnel);
lnk_ipip.path_mtu_discovery = nm_setting_ip_tunnel_get_path_mtu_discovery (s_ip_tunnel);
plerr = nm_platform_link_ipip_add (NM_PLATFORM_GET, iface, &lnk_ipip, out_plink);
plerr = nm_platform_link_ipip_add (nm_device_get_platform (device), iface, &lnk_ipip, out_plink);
if (plerr != NM_PLATFORM_ERROR_SUCCESS) {
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
"Failed to create IPIP interface '%s' for '%s': %s",
......@@ -722,7 +722,7 @@ create_and_realize (NMDevice *device,
lnk_ip6tnl.flow_label = nm_setting_ip_tunnel_get_flow_label (s_ip_tunnel);
lnk_ip6tnl.proto = nm_setting_ip_tunnel_get_mode (s_ip_tunnel) == NM_IP_TUNNEL_MODE_IPIP6 ? IPPROTO_IPIP : IPPROTO_IPV6;
plerr = nm_platform_link_ip6tnl_add (NM_PLATFORM_GET, iface, &lnk_ip6tnl, out_plink);
plerr = nm_platform_link_ip6tnl_add (nm_device_get_platform (device), iface, &lnk_ip6tnl, out_plink);
if (plerr != NM_PLATFORM_ERROR_SUCCESS) {
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
"Failed to create IPIP interface '%s' for '%s': %s",
......
......@@ -173,7 +173,7 @@ update_properties (NMDevice *device)
ifindex = nm_device_get_ifindex (device);
g_return_if_fail (ifindex > 0);
props = nm_platform_link_get_lnk_macsec (NM_PLATFORM_GET, ifindex, &plink);
props = nm_platform_link_get_lnk_macsec (nm_device_get_platform (device), ifindex, &plink);
if (!props) {
_LOGW (LOGD_PLATFORM, "could not get macsec properties");
......@@ -219,7 +219,7 @@ build_supplicant_config (NMDeviceMacsec *self, GError **error)
connection = nm_device_get_applied_connection (NM_DEVICE (self));
g_assert (connection);
con_uuid = nm_connection_get_uuid (connection);
mtu = nm_platform_link_get_mtu (NM_PLATFORM_GET,
mtu = nm_platform_link_get_mtu (nm_device_get_platform (NM_DEVICE (self)),
nm_device_get_ifindex (NM_DEVICE (self)));
config = nm_supplicant_config_new ();
......@@ -714,7 +714,7 @@ create_and_realize (NMDevice *device,
parent_ifindex = nm_device_get_ifindex (parent);
g_warn_if_fail (parent_ifindex > 0);
plerr = nm_platform_link_macsec_add (NM_PLATFORM_GET, iface, parent_ifindex, &lnk, out_plink);
plerr = nm_platform_link_macsec_add (nm_device_get_platform (device), iface, parent_ifindex, &lnk, out_plink);
if (plerr != NM_PLATFORM_ERROR_SUCCESS) {
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
"Failed to create macsec interface '%s' for '%s': %s",
......
......@@ -185,9 +185,9 @@ update_properties (NMDevice *device)
const NMPlatformLink *plink;
if (priv->props.tap)
props = nm_platform_link_get_lnk_macvtap (NM_PLATFORM_GET, nm_device_get_ifindex (device), &plink);
props = nm_platform_link_get_lnk_macvtap (nm_device_get_platform (device), nm_device_get_ifindex (device), &plink);
else
props = nm_platform_link_get_lnk_macvlan (NM_PLATFORM_GET, nm_device_get_ifindex (device), &plink);
props = nm_platform_link_get_lnk_macvlan (nm_device_get_platform (device), nm_device_get_ifindex (device), &plink);
if (!props) {
_LOGW (LOGD_PLATFORM, "could not get %s properties", priv->props.tap ? "macvtap" : "macvlan");
......@@ -251,7 +251,7 @@ create_and_realize (NMDevice *device,
lnk.no_promisc = !nm_setting_macvlan_get_promiscuous (s_macvlan);
lnk.tap = nm_setting_macvlan_get_tap (s_macvlan);
plerr = nm_platform_link_macvlan_add (NM_PLATFORM_GET, iface, parent_ifindex, &lnk, out_plink);
plerr = nm_platform_link_macvlan_add (nm_device_get_platform (device), iface, parent_ifindex, &lnk, out_plink);
if (plerr != NM_PLATFORM_ERROR_SUCCESS) {
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
"Failed to create %s interface '%s' for '%s': %s",
......@@ -399,7 +399,7 @@ complete_connection (NMDevice *device,
{
NMSettingMacvlan *s_macvlan;
nm_utils_complete_generic (NM_PLATFORM_GET,
nm_utils_complete_generic (nm_device_get_platform (device),
connection,
NM_SETTING_MACVLAN_SETTING_NAME,
existing_connections,
......
......@@ -80,7 +80,7 @@ update_properties (NMDeviceTun *self)
ifindex = nm_device_get_ifindex (NM_DEVICE (self));
if (ifindex > 0) {
if (!nm_platform_link_tun_get_properties (NM_PLATFORM_GET, ifindex, &props)) {
if (!nm_platform_link_tun_get_properties (nm_device_get_platform (NM_DEVICE (self)), ifindex, &props)) {
_LOGD (LOGD_DEVICE, "tun-properties: cannot loading tun properties from platform for ifindex %d", ifindex);
ifindex = 0;
} else if (g_strcmp0 (priv->mode, props.mode) != 0) {
......@@ -138,7 +138,7 @@ complete_connection (NMDevice *device,
{
NMSettingTun *s_tun;
nm_utils_complete_generic (NM_PLATFORM_GET,
nm_utils_complete_generic (nm_device_get_platform (device),
connection,
NM_SETTING_TUN_SETTING_NAME,
existing_connections,
......@@ -181,7 +181,7 @@ update_connection (NMDevice *device, NMConnection *connection)
nm_connection_add_setting (connection, (NMSetting *) s_tun);
}
if (!nm_platform_link_tun_get_properties (NM_PLATFORM_GET, nm_device_get_ifindex (device), &props)) {
if (!nm_platform_link_tun_get_properties (nm_device_get_platform (device), nm_device_get_ifindex (device), &props)) {
_LOGW (LOGD_PLATFORM, "failed to get TUN interface info while updating connection.");
return;
}
......@@ -232,7 +232,7 @@ create_and_realize (NMDevice *device,
user = _nm_utils_ascii_str_to_int64 (nm_setting_tun_get_owner (s_tun), 10, 0, G_MAXINT32, -1);
group = _nm_utils_ascii_str_to_int64 (nm_setting_tun_get_group (s_tun), 10, 0, G_MAXINT32, -1);
plerr = nm_platform_link_tun_add (NM_PLATFORM_GET, iface,
plerr = nm_platform_link_tun_add (nm_device_get_platform (device), iface,
nm_setting_tun_get_mode (s_tun) == NM_SETTING_TUN_MODE_TAP,
user, group,
nm_setting_tun_get_pi (s_tun),
......
......@@ -69,7 +69,7 @@ update_properties (NMDevice *device)
ifindex = nm_device_get_ifindex (device);
if (!nm_platform_link_veth_get_properties (NM_PLATFORM_GET, ifindex, &peer_ifindex))
if (!nm_platform_link_veth_get_properties (nm_device_get_platform (device), ifindex, &peer_ifindex))
peer_ifindex = 0;
nm_device_parent_set_ifindex (device, peer_ifindex);
......
......@@ -186,7 +186,7 @@ update_properties (NMDevice *device)
ifindex = nm_device_get_ifindex (device);
if (ifindex > 0)