From 2805555bd2d64ae2ea47f52c525b1a2bddd1224a Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 4 Nov 2016 14:02:50 +0100 Subject: ip-tunnel: fail the activation for unknown tunnel modes When an IP-tunnel connection with mode different from the implemented ones was activated, an assertion failed in tunnel_mode_to_link_type(). Instead we should return NM_LINK_TYPE_UNKNOWN there and fail the activation. --- src/devices/nm-device-ip-tunnel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/devices/nm-device-ip-tunnel.c') diff --git a/src/devices/nm-device-ip-tunnel.c b/src/devices/nm-device-ip-tunnel.c index 0aef9d2ef9..d0b2ca71fc 100644 --- a/src/devices/nm-device-ip-tunnel.c +++ b/src/devices/nm-device-ip-tunnel.c @@ -586,7 +586,7 @@ tunnel_mode_to_link_type (NMIPTunnelMode tunnel_mode) case NM_IP_TUNNEL_MODE_SIT: return NM_LINK_TYPE_SIT; default: - g_return_val_if_reached (NM_LINK_TYPE_UNKNOWN); + return NM_LINK_TYPE_UNKNOWN; } } @@ -1004,7 +1004,7 @@ create_device (NMDeviceFactory *factory, mode = platform_link_to_tunnel_mode (plink); } - if (mode == NM_IP_TUNNEL_MODE_UNKNOWN) + if (mode == NM_IP_TUNNEL_MODE_UNKNOWN || link_type == NM_LINK_TYPE_UNKNOWN) return NULL; return (NMDevice *) g_object_new (NM_TYPE_DEVICE_IP_TUNNEL, -- cgit v1.2.1