summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-05-09 05:00:52 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-05-11 00:33:22 +0200
commitba1707ca54638376f73dd7b9e55a183250af573f (patch)
treeb9f3de926464fd900c428c5383b2589ab381e7ca /lib
parentMerge pull request #4305 from qlyoung/fix-lua-build (diff)
downloadfrr-ba1707ca54638376f73dd7b9e55a183250af573f.tar.xz
frr-ba1707ca54638376f73dd7b9e55a183250af573f.zip
lib: in routemap.c if using a switch for an enum get rid of enum
From looking at a current PR: #4297, we see that routemap.c code was not properly updating dependency information for some route_map_event_t enum types. This has lead to dependancy information not being updated properly. While at this time I do not know whether or not we need to update the switch for the missing types, I do know that if we add something in the future we should make the person adding the code consider this. So let's remove all `default:` switch statement handlers from routemap.c when switching on an enum. Future time will need to be spent to figure out what is needed to be done here. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/routemap.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index e8bdaa68f..f74baa38b 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -902,7 +902,7 @@ static const char *route_map_type_str(enum route_map_type type)
case RMAP_DENY:
return "deny";
break;
- default:
+ case RMAP_ANY:
return "";
break;
}
@@ -1795,7 +1795,14 @@ static int route_map_dep_update(struct hash *dephash, const char *dep_name,
dep = NULL;
}
break;
- default:
+ case RMAP_EVENT_SET_ADDED:
+ case RMAP_EVENT_SET_DELETED:
+ case RMAP_EVENT_SET_REPLACED:
+ case RMAP_EVENT_MATCH_ADDED:
+ case RMAP_EVENT_MATCH_DELETED:
+ case RMAP_EVENT_MATCH_REPLACED:
+ case RMAP_EVENT_INDEX_ADDED:
+ case RMAP_EVENT_INDEX_DELETED:
break;
}
@@ -1846,7 +1853,18 @@ static struct hash *route_map_get_dep_hash(route_map_event_t event)
case RMAP_EVENT_FILTER_DELETED:
upd8_hash = route_map_dep_hash[ROUTE_MAP_DEP_FILTER];
break;
- default:
+ /*
+ * Should we actually be ignoring these?
+ * I am not sure but at this point in time, let
+ * us get them into this switch and we can peel
+ * them into the appropriate place in the future
+ */
+ case RMAP_EVENT_SET_ADDED:
+ case RMAP_EVENT_SET_DELETED:
+ case RMAP_EVENT_SET_REPLACED:
+ case RMAP_EVENT_MATCH_REPLACED:
+ case RMAP_EVENT_INDEX_ADDED:
+ case RMAP_EVENT_INDEX_DELETED:
upd8_hash = NULL;
break;
}