summaryrefslogtreecommitdiffstats
path: root/lib/vrf.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2020-03-24 18:16:06 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2020-04-13 23:03:42 +0200
commitf7d459250939713b8707fe0fe44d2e7e5dd0276a (patch)
treed7a5b2344550c2573aa0a2b24dfa24068a19923e /lib/vrf.c
parentlib: re-add accidentally deleted pfx family set (diff)
downloadfrr-f7d459250939713b8707fe0fe44d2e7e5dd0276a.tar.xz
frr-f7d459250939713b8707fe0fe44d2e7e5dd0276a.zip
lib: work around enum issue in old gcc
I'd like to keep the explicit check here, but since underlying type of enum is implementation defined, theres some inconsistency using -Wall -Werror in older compilers here Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r--lib/vrf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/vrf.c b/lib/vrf.c
index 14f965ac8..e2afa2b23 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -595,8 +595,15 @@ int vrf_get_backend(void)
int vrf_configure_backend(enum vrf_backend_type backend)
{
- if (backend < 0 || backend >= VRF_BACKEND_MAX)
+ /* Work around issue in old gcc */
+ switch (backend) {
+ case VRF_BACKEND_UNKNOWN:
+ case VRF_BACKEND_NETNS:
+ case VRF_BACKEND_VRF_LITE:
+ break;
+ default:
return -1;
+ }
vrf_backend = backend;
vrf_backend_configured = 1;