diff options
Diffstat (limited to 'src/devices/nm-device-macvlan.c')
| -rw-r--r-- | src/devices/nm-device-macvlan.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/devices/nm-device-macvlan.c b/src/devices/nm-device-macvlan.c index cd02cb8e..c431fe89 100644 --- a/src/devices/nm-device-macvlan.c +++ b/src/devices/nm-device-macvlan.c @@ -223,12 +223,19 @@ 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); lnk.mode = setting_mode_to_platform (nm_setting_macvlan_get_mode (s_macvlan)); if (!lnk.mode) { - nm_log_info (LOGD_DEVICE, "unsupported MACVLAN mode %u in connection %s", + g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, + "unsupported MACVLAN mode %u in connection %s", nm_setting_macvlan_get_mode (s_macvlan), nm_connection_get_uuid (connection)); return FALSE; |