summaryrefslogtreecommitdiff
path: root/libnm-core/nm-setting-ip-tunnel.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-11-08 09:42:31 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2016-11-09 17:45:39 +0100
commita6416cbd134b7f38408e659bfb346ca8f2af5a24 (patch)
tree1e206abdac4802b072258ebc4a357acbc850b8fb /libnm-core/nm-setting-ip-tunnel.c
parentcd73f281cc27d2cd994d2db2711e2d59f50287ed (diff)
downloadNetworkManager-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 'libnm-core/nm-setting-ip-tunnel.c')
-rw-r--r--libnm-core/nm-setting-ip-tunnel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libnm-core/nm-setting-ip-tunnel.c b/libnm-core/nm-setting-ip-tunnel.c
index e7d625c381..50630a4572 100644
--- a/libnm-core/nm-setting-ip-tunnel.c
+++ b/libnm-core/nm-setting-ip-tunnel.c
@@ -291,7 +291,7 @@ static gboolean
verify (NMSetting *setting, NMConnection *connection, GError **error)
{
NMSettingIPTunnelPrivate *priv = NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting);
- int family;
+ int family = AF_UNSPEC;
switch (priv->mode) {
case NM_IP_TUNNEL_MODE_IPIP:
@@ -307,8 +307,8 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
case NM_IP_TUNNEL_MODE_VTI6:
family = AF_INET6;
break;
- default:
- family = AF_UNSPEC;
+ case NM_IP_TUNNEL_MODE_UNKNOWN:
+ break;
}
if (family == AF_UNSPEC) {