diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c index 5c61d4766c..0465ae36b2 100644 --- a/src/devices/nm-device-infiniband.c +++ b/src/devices/nm-device-infiniband.c @@ -250,6 +250,12 @@ create_and_realize (NMDevice *device, return FALSE; } + if (!parent) { + g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, + "InfiniBand partitions can not be created without a parent interface"); + return FALSE; + } + if (!NM_IS_DEVICE_INFINIBAND (parent)) { g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, "Parent interface %s must be an InfiniBand interface", diff --git a/src/devices/nm-device-macvlan.c b/src/devices/nm-device-macvlan.c index 1360517440..c431fe891c 100644 --- a/src/devices/nm-device-macvlan.c +++ b/src/devices/nm-device-macvlan.c @@ -223,6 +223,12 @@ create_and_realize (NMDevice *device, s_macvlan = nm_connection_get_setting_macvlan (connection); g_assert (s_macvlan); + if (!parent) { + g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, + "MACVLAN devices can not be created without a parent interface"); + return FALSE; + } + parent_ifindex = nm_device_get_ifindex (parent); g_warn_if_fail (parent_ifindex > 0); diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c index ef30bbeb74..eb6527de8e 100644 --- a/src/devices/nm-device-vlan.c +++ b/src/devices/nm-device-vlan.c @@ -222,6 +222,12 @@ create_and_realize (NMDevice *device, s_vlan = nm_connection_get_setting_vlan (connection); g_assert (s_vlan); + if (!parent) { + g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, + "VLAN devices can not be created without a parent interface"); + return FALSE; + } + if (!nm_device_supports_vlans (parent)) { g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, "no support for VLANs on interface %s of type %s",