Generic check_connection_compatible() already does the check.
static gboolean
check_connection_compatible (NMDevice *device, NMConnection *connection)
{
- const char *iface;
NMSettingBond *s_bond;
if (!NM_DEVICE_CLASS (nm_device_bond_parent_class)->check_connection_compatible (device, connection))
if (!s_bond || !nm_connection_is_type (connection, NM_SETTING_BOND_SETTING_NAME))
return FALSE;
- /* Bond connections must specify the virtual interface name */
- iface = nm_connection_get_interface_name (connection);
- if (!iface || strcmp (nm_device_get_iface (device), iface))
- return FALSE;
-
/* FIXME: match bond properties like mode, etc? */
return TRUE;
static gboolean
check_connection_compatible (NMDevice *device, NMConnection *connection)
{
- const char *iface;
NMSettingBridge *s_bridge;
const char *mac_address;
if (!s_bridge || !nm_connection_is_type (connection, NM_SETTING_BRIDGE_SETTING_NAME))
return FALSE;
- /* Bridge connections must specify the virtual interface name */
- iface = nm_connection_get_interface_name (connection);
- if (!iface || strcmp (nm_device_get_iface (device), iface))
- return FALSE;
-
mac_address = nm_setting_bridge_get_mac_address (s_bridge);
if (mac_address && nm_device_is_real (device)) {
const char *hw_addr;
{
NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE (device);
NMSettingMacvlan *s_macvlan;
- const char *parent, *iface = NULL;
+ const char *parent = NULL;
if (!NM_DEVICE_CLASS (nm_device_macvlan_parent_class)->check_connection_compatible (device, connection))
return FALSE;
}
}
- /* Ensure the interface name matches */
- iface = nm_connection_get_interface_name (connection);
- if (iface) {
- if (g_strcmp0 (nm_device_get_ip_iface (device), iface) != 0)
- return FALSE;
- }
-
return TRUE;
}
{
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (device);
NMSettingVlan *s_vlan;
- const char *parent, *iface = NULL;
+ const char *parent = NULL;
if (!NM_DEVICE_CLASS (nm_device_vlan_parent_class)->check_connection_compatible (device, connection))
return FALSE;
}
}
- /* Ensure the interface name matches. If not specified we assume a match
- * since both the parent interface and the VLAN ID matched by the time we
- * get here.
- */
- iface = nm_connection_get_interface_name (connection);
- if (iface) {
- if (g_strcmp0 (nm_device_get_ip_iface (device), iface) != 0)
- return FALSE;
- }
-
return TRUE;
}
{
NMDeviceVxlanPrivate *priv = NM_DEVICE_VXLAN_GET_PRIVATE (device);
NMSettingVxlan *s_vxlan;
- const char *iface, *parent;
+ const char *parent;
if (!NM_DEVICE_CLASS (nm_device_vxlan_parent_class)->check_connection_compatible (device, connection))
return FALSE;
if (!s_vxlan)
return FALSE;
- iface = nm_connection_get_interface_name (connection);
- if (iface) {
- if (g_strcmp0 (nm_device_get_ip_iface (device), iface) != 0)
- return FALSE;
- }
-
if (nm_device_is_real (device)) {
parent = nm_setting_vxlan_get_parent (s_vxlan);
if ( parent
static gboolean
check_connection_compatible (NMDevice *device, NMConnection *connection)
{
- const char *iface;
NMSettingTeam *s_team;
if (!NM_DEVICE_CLASS (nm_device_team_parent_class)->check_connection_compatible (device, connection))
if (!s_team || !nm_connection_is_type (connection, NM_SETTING_TEAM_SETTING_NAME))
return FALSE;
- /* Team connections must specify the virtual interface name */
- iface = nm_connection_get_interface_name (connection);
- if (!iface || strcmp (nm_device_get_iface (device), iface))
- return FALSE;
-
/* FIXME: match team properties like mode, etc? */
return TRUE;