diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-01-30 10:09:04 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-01-31 15:15:42 -0500 | 
| commit | d0038397b7c3d20a3c14c9fab5c8d012d145faae (patch) | |
| tree | 29b094d9c1dd1f6653f06635c6a26e338e7c4e4c | |
| parent | a348c9456f88d45b35d7e293208a6cc348cf5ad6 (diff) | |
nhrpd: Add missing enum's to switch statement
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| -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 81d9bb255f..a1b22645c0 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 4ac30a7d75..104c81bde4 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 698c6d0cdf..aa0bbbc4cc 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 6ba2399e05..a54b43908b 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;  	}  }  | 
