diff options
author | Donald Sharp <sharpd@nvidia.com> | 2023-01-30 16:09:04 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2023-01-31 21:15:42 +0100 |
commit | d0038397b7c3d20a3c14c9fab5c8d012d145faae (patch) | |
tree | 29b094d9c1dd1f6653f06635c6a26e338e7c4e4c /nhrpd | |
parent | isisd: Add missing enum's to switch statement (diff) | |
download | frr-d0038397b7c3d20a3c14c9fab5c8d012d145faae.tar.xz frr-d0038397b7c3d20a3c14c9fab5c8d012d145faae.zip |
nhrpd: Add missing enum's to switch statement
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'nhrpd')
-rw-r--r-- | nhrpd/nhrp_cache.c | 9 | ||||
-rw-r--r-- | nhrpd/nhrp_interface.c | 12 | ||||
-rw-r--r-- | nhrpd/nhrp_route.c | 12 | ||||
-rw-r--r-- | nhrpd/vici.c | 20 |
4 files changed, 37 insertions, 16 deletions
diff --git a/nhrpd/nhrp_cache.c b/nhrpd/nhrp_cache.c index 81d9bb255..a1b22645c 100644 --- a/nhrpd/nhrp_cache.c +++ b/nhrpd/nhrp_cache.c @@ -330,7 +330,14 @@ static void nhrp_cache_update_timers(struct nhrp_cache *c) thread_add_timer_msec(master, nhrp_cache_do_free, c, 10, &c->t_timeout); break; - default: + case NHRP_CACHE_INCOMPLETE: + case NHRP_CACHE_NEGATIVE: + case NHRP_CACHE_CACHED: + case NHRP_CACHE_DYNAMIC: + case NHRP_CACHE_NHS: + case NHRP_CACHE_STATIC: + case NHRP_CACHE_LOCAL: + case NHRP_CACHE_NUM_TYPES: if (c->cur.expires) thread_add_timer(master, nhrp_cache_do_timeout, c, c->cur.expires - monotime(NULL), diff --git a/nhrpd/nhrp_interface.c b/nhrpd/nhrp_interface.c index 4ac30a7d7..104c81bde 100644 --- a/nhrpd/nhrp_interface.c +++ b/nhrpd/nhrp_interface.c @@ -184,16 +184,17 @@ void nhrp_interface_update_nbma(struct interface *ifp, struct nhrp_interface *nifp = ifp->info, *nbmanifp = NULL; struct interface *nbmaifp = NULL; union sockunion nbma; + struct in_addr saddr = {0}; sockunion_family(&nbma) = AF_UNSPEC; if (nifp->source) nbmaifp = if_lookup_by_name(nifp->source, nifp->link_vrf_id); - switch (ifp->ll_type) { - case ZEBRA_LLT_IPGRE: { - struct in_addr saddr = {0}; - + if (ifp->ll_type != ZEBRA_LLT_IPGRE) + debugf(NHRP_DEBUG_IF, "%s: Ignoring non GRE interface type %u", + __func__, ifp->ll_type); + else { if (!gre_info) { nhrp_send_zebra_gre_request(ifp); return; @@ -214,9 +215,6 @@ void nhrp_interface_update_nbma(struct interface *ifp, nbmaifp = if_lookup_by_index(nifp->link_idx, nifp->link_vrf_id); - } break; - default: - break; } if (nbmaifp) diff --git a/nhrpd/nhrp_route.c b/nhrpd/nhrp_route.c index 698c6d0cd..aa0bbbc4c 100644 --- a/nhrpd/nhrp_route.c +++ b/nhrpd/nhrp_route.c @@ -139,7 +139,17 @@ void nhrp_route_announce(int add, enum nhrp_cache_type type, /* Regular route, so these are announced * to other routing daemons */ break; - default: + case NHRP_CACHE_INVALID: + case NHRP_CACHE_INCOMPLETE: + /* + * I cannot believe that we want to set a FIB_OVERRIDE + * for invalid state or incomplete. But this matches + * the original code. Someone will probably notice + * the problem eventually + */ + case NHRP_CACHE_CACHED: + case NHRP_CACHE_LOCAL: + case NHRP_CACHE_NUM_TYPES: SET_FLAG(api.flags, ZEBRA_FLAG_FIB_OVERRIDE); break; } diff --git a/nhrpd/vici.c b/nhrpd/vici.c index 6ba2399e0..a54b43908 100644 --- a/nhrpd/vici.c +++ b/nhrpd/vici.c @@ -135,11 +135,6 @@ static void vici_parse_message(struct vici_conn *vici, struct zbuf *msg, case VICI_LIST_END: debugf(NHRP_DEBUG_VICI, "VICI: List end"); break; - default: - debugf(NHRP_DEBUG_VICI, - "VICI: Unsupported message component type %d", - *type); - return; } } } @@ -207,7 +202,12 @@ static void parse_sa_message(struct vici_message_ctx *ctx, } } break; - default: + case VICI_START: + case VICI_KEY_VALUE: + case VICI_LIST_START: + case VICI_LIST_ITEM: + case VICI_LIST_END: + case VICI_END: if (!key || !key->ptr) break; @@ -286,7 +286,13 @@ static void parse_cmd_response(struct vici_message_ctx *ctx, && blob2buf(val, buf, sizeof(buf))) flog_err(EC_NHRP_SWAN, "VICI: strongSwan: %s", buf); break; - default: + case VICI_START: + case VICI_SECTION_START: + case VICI_SECTION_END: + case VICI_LIST_START: + case VICI_LIST_ITEM: + case VICI_LIST_END: + case VICI_END: break; } } |