diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2016-11-04 14:02:50 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-11-09 17:45:34 +0100 |
commit | 2805555bd2d64ae2ea47f52c525b1a2bddd1224a (patch) | |
tree | 70fe4b80f78e5e2878891d79ab39bd57d6f19a0e /src/devices/nm-device-ip-tunnel.c | |
parent | 5aea82d383a09d5ea8eba61db2e204adaa2d68da (diff) | |
download | NetworkManager-2805555bd2d64ae2ea47f52c525b1a2bddd1224a.tar.gz |
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.
Diffstat (limited to 'src/devices/nm-device-ip-tunnel.c')
-rw-r--r-- | src/devices/nm-device-ip-tunnel.c | 4 |
1 files changed, 2 insertions, 2 deletions
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, |