diff options
| author | Michael Biebl <biebl@debian.org> | 2016-04-20 21:11:10 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2016-04-20 21:11:10 +0200 |
| commit | 78c3b8801ecf4975e5da1af3b10ae20dd2d876de (patch) | |
| tree | 19b80fbe9429f554a48ed126911026d4fa8a4b3f /src/devices/nm-device-macvlan.c | |
| parent | 288a08a3672a89a9bfdb8354b6863cc039759fc2 (diff) | |
Imported Upstream version 1.2.0 upstream/1.2.0
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; |