diff options
author | Thomas Haller <thaller@redhat.com> | 2016-11-08 09:42:31 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-11-09 17:45:39 +0100 |
commit | a6416cbd134b7f38408e659bfb346ca8f2af5a24 (patch) | |
tree | 1e206abdac4802b072258ebc4a357acbc850b8fb /src | |
parent | cd73f281cc27d2cd994d2db2711e2d59f50287ed (diff) | |
download | NetworkManager-a6416cbd134b7f38408e659bfb346ca8f2af5a24.tar.gz |
ip-tunnel: tigthen up checks for valid IP tunnel modes
The compiler warns us when we don't specify all enum values
in a switch(), provided that default: is missing.
Make use of that to get a warning when we add a new tunnel mode.
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/nm-device-ip-tunnel.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/devices/nm-device-ip-tunnel.c b/src/devices/nm-device-ip-tunnel.c index d0b2ca71fc..8732ddf9b5 100644 --- a/src/devices/nm-device-ip-tunnel.c +++ b/src/devices/nm-device-ip-tunnel.c @@ -585,9 +585,15 @@ tunnel_mode_to_link_type (NMIPTunnelMode tunnel_mode) return NM_LINK_TYPE_IPIP; case NM_IP_TUNNEL_MODE_SIT: return NM_LINK_TYPE_SIT; - default: + case NM_IP_TUNNEL_MODE_VTI: + case NM_IP_TUNNEL_MODE_IP6GRE: + case NM_IP_TUNNEL_MODE_VTI6: + case NM_IP_TUNNEL_MODE_ISATAP: return NM_LINK_TYPE_UNKNOWN; + case NM_IP_TUNNEL_MODE_UNKNOWN: + break; } + g_return_val_if_reached (NM_LINK_TYPE_UNKNOWN); } /*****************************************************************************/ |