diff options
48 files changed, 114 insertions, 110 deletions
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c index 0e70de9d46..12bd45d9e3 100644 --- a/bgpd/bgp_aspath.c +++ b/bgpd/bgp_aspath.c @@ -1892,7 +1892,7 @@ struct aspath *aspath_reconcile_as4(struct aspath *aspath,  						"[AS4] AS4PATHmangle: AS_CONFED_SEQUENCE falls across 2/4 ASN boundary somewhere, broken..");  				hops = seg->length;  			} -		/* fallthru */ +			fallthrough;  		case AS_SEQUENCE:  			cpasns = MIN(seg->length, hops);  			hops -= seg->length; diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 4014b4b92a..6925aff727 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -2323,11 +2323,8 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,  				/*  				 * NOTE: intentional fall through  				 * - for consistency in rx processing -				 * -				 * The following comment is to signal GCC this intention -				 * and suppress the warning  				 */ -	/* FALLTHRU */ +		fallthrough;  	case BGP_ATTR_NHLEN_IPV4:  		stream_get(&attr->mp_nexthop_global_in, s, IPV4_MAX_BYTELEN);  		/* Probably needed for RFC 2283 */ diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c index e522307134..8336d6f311 100644 --- a/bgpd/bgp_clist.c +++ b/bgpd/bgp_clist.c @@ -128,6 +128,7 @@ static void community_entry_free(struct community_entry *entry)  		XFREE(MTYPE_COMMUNITY_LIST_CONFIG, entry->config);  		if (entry->reg)  			bgp_regex_free(entry->reg); +		break;  	default:  		break;  	} diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index eef3b64408..aa806b8dc1 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -445,7 +445,7 @@ void bgp_timer_set(struct peer_connection *connection)  		EVENT_OFF(peer->connection->t_pmax_restart);  		EVENT_OFF(peer->t_refresh_stalepath); -	/* fallthru */ +		fallthrough;  	case Clearing:  		EVENT_OFF(connection->t_start);  		EVENT_OFF(connection->t_connect); @@ -2384,6 +2384,7 @@ void bgp_fsm_nht_update(struct peer_connection *connection, struct peer *peer,  		    && (peer->gtsm_hops == BGP_GTSM_HOPS_CONNECTED  			|| peer->bgp->fast_convergence))  			BGP_EVENT_ADD(connection, TCP_fatal_error); +		break;  	case Clearing:  	case Deleted:  	case BGP_STATUS_MAX: diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 28a2448a20..866930c732 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -1028,6 +1028,7 @@ static int bgp_capability_parse(struct peer *peer, size_t length,  						BGP_NOTIFY_OPEN_MALFORMED_ATTR);  				return -1;  			} +			break;  		/* we deliberately ignore unknown codes, see below */  		default:  			break; diff --git a/bgpd/bgp_routemap_nb_config.c b/bgpd/bgp_routemap_nb_config.c index 370295b6c3..6ea8ebe6ab 100644 --- a/bgpd/bgp_routemap_nb_config.c +++ b/bgpd/bgp_routemap_nb_config.c @@ -1747,7 +1747,7 @@ int lib_route_map_entry_set_action_rmap_set_action_ipv6_address_modify(  			    || IN6_IS_ADDR_LINKLOCAL(&i6a))  				return NB_ERR_VALIDATION;  		} -	/* FALLTHROUGH */ +		return NB_OK;  	case NB_EV_PREPARE:  	case NB_EV_ABORT:  		return NB_OK; diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 2fb4e6bccd..12e462a8ca 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -186,7 +186,6 @@ int bgp_option_set(int flag)  int bgp_option_unset(int flag)  {  	switch (flag) { -	/* Fall through.  */  	case BGP_OPT_NO_ZEBRA:  	case BGP_OPT_NO_FIB:  		UNSET_FLAG(bm->options, flag); diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c index 5b6961d18a..676d0771cd 100644 --- a/bgpd/rfapi/bgp_rfapi_cfg.c +++ b/bgpd/rfapi/bgp_rfapi_cfg.c @@ -1720,7 +1720,8 @@ DEFUN (vnc_nve_group_export_no_routemap,  	switch (argv[idx]->text[0]) {  	case 'z':  		is_bgp = 0; -	/* fall thru */ +		idx += 2; +		break;  	case 'b':  		idx += 2;  		break; @@ -3590,7 +3591,9 @@ DEFUN (vnc_l2_group_rt,  	switch (argv[1]->arg[0]) {  	case 'b': -		do_export = 1; /* fall through */ +		do_export = 1; +		do_import = 1; +		break;  	case 'i':  		do_import = 1;  		break; diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index 252b6d632a..43625b11a6 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -4151,6 +4151,7 @@ static int rfapi_vty_show_nve_summary(struct vty *vty,  		case SHOW_NVE_SUMMARY_RESPONSES:  			rfapiRibShowResponsesSummary(vty); +			break;  		case SHOW_NVE_SUMMARY_UNKNOWN_NVES:  		case SHOW_NVE_SUMMARY_MAX: diff --git a/configure.ac b/configure.ac index d097a13fda..9985cdcbf8 100644 --- a/configure.ac +++ b/configure.ac @@ -365,6 +365,7 @@ AC_C_FLAG([-Wpointer-arith])  AC_C_FLAG([-Wbad-function-cast])  AC_C_FLAG([-Wwrite-strings])  AC_C_FLAG([-Wundef]) +AC_C_FLAG([-Wimplicit-fallthrough])  if test "$enable_gcc_ultra_verbose" = "yes" ; then    AC_C_FLAG([-Wcast-qual])    AC_C_FLAG([-Wmissing-noreturn]) diff --git a/ldpd/init.c b/ldpd/init.c index f0cb98e5c0..c34d18f8b2 100644 --- a/ldpd/init.c +++ b/ldpd/init.c @@ -229,7 +229,7 @@ send_capability(struct nbr *nbr, uint16_t capability, int enable)  		 * Announcement Parameter in Capability messages sent to  		 * its peers".  		 */ -		/* FALLTHROUGH */ +		fallthrough;  	default:  		fatalx("send_capability: unsupported capability");  	} @@ -333,7 +333,7 @@ recv_capability(struct nbr *nbr, char *buf, uint16_t len)  			 * parameter and process any other Capability Parameters  			 * in the message".  			 */ -			/* FALLTHROUGH */ +			fallthrough;  		default:  			if (!CHECK_FLAG(ntohs(tlv.type), UNKNOWN_FLAG))  				send_notification_rtlvs(nbr, S_UNSSUPORTDCAP, diff --git a/ldpd/ldp_vty_exec.c b/ldpd/ldp_vty_exec.c index 906b5c1bf2..f3bcd1b254 100644 --- a/ldpd/ldp_vty_exec.c +++ b/ldpd/ldp_vty_exec.c @@ -1106,7 +1106,7 @@ show_lib_msg(struct vty *vty, struct imsg *imsg, struct show_params *params)  		if (params->lib.remote_label != NO_LABEL &&  		    params->lib.remote_label != rt->remote_label)  			return (0); -		/* FALLTHROUGH */ +		fallthrough;  	case IMSG_CTL_SHOW_LIB_RCVD:  		rt = imsg->data; diff --git a/ldpd/neighbor.c b/ldpd/neighbor.c index 5209c55bb8..d40728b043 100644 --- a/ldpd/neighbor.c +++ b/ldpd/neighbor.c @@ -505,21 +505,12 @@ nbr_start_idtimer(struct nbr *nbr)  {  	int	secs; -	secs = INIT_DELAY_TMR; -	switch(nbr->idtimer_cnt) { -	default: +	if (nbr->idtimer_cnt > 2) {  		/* do not further increase the counter */  		secs = MAX_DELAY_TMR; -		break; -	case 2: -		secs *= 2; -		/* FALLTHROUGH */ -	case 1: -		secs *= 2; -		/* FALLTHROUGH */ -	case 0: +	} else { +		secs = INIT_DELAY_TMR * (1 << nbr->idtimer_cnt);  		nbr->idtimer_cnt++; -		break;  	}  	EVENT_OFF(nbr->initdelay_timer); diff --git a/lib/base64.c b/lib/base64.c index 1507b0252b..ee2e838c01 100644 --- a/lib/base64.c +++ b/lib/base64.c @@ -9,6 +9,7 @@  #endif  #include "base64.h" +#include "compiler.h"  static const int CHARS_PER_LINE = 72;  static const char *ENCODING = @@ -41,6 +42,7 @@ int base64_encode_block(const char *plaintext_in, int length_in, char *code_out,  	switch (state_in->step) {  		while (1) { +			fallthrough;  			case step_A:  				if (plainchar == plaintextend) {  					state_in->result = result; @@ -51,7 +53,7 @@ int base64_encode_block(const char *plaintext_in, int length_in, char *code_out,  				result = (fragment & 0x0fc) >> 2;  				*codechar++ = base64_encode_value(result);  				result = (fragment & 0x003) << 4; -				/* fall through */ +				fallthrough;  			case step_B:  				if (plainchar == plaintextend) {  					state_in->result = result; @@ -62,7 +64,7 @@ int base64_encode_block(const char *plaintext_in, int length_in, char *code_out,  				result |= (fragment & 0x0f0) >> 4;  				*codechar++ = base64_encode_value(result);  				result = (fragment & 0x00f) << 2; -				/* fall through */ +				fallthrough;  			case step_C:  				if (plainchar == plaintextend) {  					state_in->result = result; @@ -146,6 +148,7 @@ int base64_decode_block(const char *code_in, int length_in, char *plaintext_out,  	switch (state_in->step) {  		while (1) { +			fallthrough;  			case step_a:  				do {  					if (codec == code_in+length_in) { @@ -156,7 +159,7 @@ int base64_decode_block(const char *code_in, int length_in, char *plaintext_out,  					fragmt = base64_decode_value(*codec++);  				} while (fragmt < 0);  				*plainc = (fragmt & 0x03f) << 2; -				/* fall through */ +				fallthrough;  			case step_b:  				do {  					if (codec == code_in+length_in) { @@ -168,7 +171,7 @@ int base64_decode_block(const char *code_in, int length_in, char *plaintext_out,  				} while (fragmt < 0);  				*plainc++ |= (fragmt & 0x030) >> 4;  				*plainc = (fragmt & 0x00f) << 4; -				/* fall through */ +				fallthrough;  			case step_c:  				do {  					if (codec == code_in+length_in) { @@ -180,7 +183,7 @@ int base64_decode_block(const char *code_in, int length_in, char *plaintext_out,  				} while (fragmt < 0);  				*plainc++ |= (fragmt & 0x03c) >> 2;  				*plainc = (fragmt & 0x003) << 6; -				/* fall through */ +				fallthrough;  			case step_d:  				do {  					if (codec == code_in+length_in) { diff --git a/lib/command_match.c b/lib/command_match.c index f740b72600..97e6aeb469 100644 --- a/lib/command_match.c +++ b/lib/command_match.c @@ -405,10 +405,10 @@ enum matcher_rv command_complete(struct graph *graph, vector vline,  				listnode_add(next, newstack);  				break;  			case partly_match: -				trace_matcher("trivial_match\n"); +				trace_matcher("partly_match\n");  				if (exact_match_exists && !last_token)  					break; -			/* fallthru */ +				fallthrough;  			case exact_match:  				trace_matcher("exact_match\n");  				if (last_token) { diff --git a/lib/compiler.h b/lib/compiler.h index ce6727685f..0a54c02d20 100644 --- a/lib/compiler.h +++ b/lib/compiler.h @@ -33,7 +33,7 @@ extern "C" {  #  define _RET_NONNULL    , returns_nonnull  #endif  #if __has_attribute(fallthrough) -#  define _FALLTHROUGH __attribute__((fallthrough)); +#  define fallthrough __attribute__((fallthrough));  #endif  # define _CONSTRUCTOR(x)  constructor(x)  # define _DEPRECATED(x) deprecated(x) @@ -57,7 +57,7 @@ extern "C" {  #  define __has_attribute(x) 0  #endif  #if __GNUC__ >= 7 -#  define _FALLTHROUGH __attribute__((fallthrough)); +#  define fallthrough __attribute__((fallthrough));  #endif  #endif @@ -112,8 +112,8 @@ extern "C" {  #ifndef _ALLOC_SIZE  # define _ALLOC_SIZE(x)  #endif -#ifndef _FALLTHROUGH -#define _FALLTHROUGH +#ifndef fallthrough +#define fallthrough  #endif  #ifndef _DEPRECATED  #define _DEPRECATED(x) deprecated diff --git a/lib/jhash.c b/lib/jhash.c index 0d561ef3a4..4e02112e09 100644 --- a/lib/jhash.c +++ b/lib/jhash.c @@ -86,34 +86,34 @@ uint32_t jhash(const void *key, uint32_t length, uint32_t initval)  	switch (len) {  	case 11:  		c += ((uint32_t)k[10] << 24); -	/* fallthru */ +		fallthrough;  	case 10:  		c += ((uint32_t)k[9] << 16); -	/* fallthru */ +		fallthrough;  	case 9:  		c += ((uint32_t)k[8] << 8); -	/* fallthru */ +		fallthrough;  	case 8:  		b += ((uint32_t)k[7] << 24); -	/* fallthru */ +		fallthrough;  	case 7:  		b += ((uint32_t)k[6] << 16); -	/* fallthru */ +		fallthrough;  	case 6:  		b += ((uint32_t)k[5] << 8); -	/* fallthru */ +		fallthrough;  	case 5:  		b += k[4]; -	/* fallthru */ +		fallthrough;  	case 4:  		a += ((uint32_t)k[3] << 24); -	/* fallthru */ +		fallthrough;  	case 3:  		a += ((uint32_t)k[2] << 16); -	/* fallthru */ +		fallthrough;  	case 2:  		a += ((uint32_t)k[1] << 8); -	/* fallthru */ +		fallthrough;  	case 1:  		a += k[0];  	} @@ -148,7 +148,7 @@ uint32_t jhash2(const uint32_t *k, uint32_t length, uint32_t initval)  	switch (len) {  	case 2:  		b += k[1]; -	/* fallthru */ +		fallthrough;  	case 1:  		a += k[0];  	} diff --git a/lib/libfrr.c b/lib/libfrr.c index 33237df5fc..e80355f3b8 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -218,7 +218,8 @@ bool frr_zclient_addr(struct sockaddr_storage *sa, socklen_t *sa_len,  			break;  		case '6':  			path++; -		/* fallthrough */ +			af = AF_INET6; +			break;  		default:  			af = AF_INET6;  			break; diff --git a/lib/nexthop.c b/lib/nexthop.c index 8df57e36a2..4ddb53cd96 100644 --- a/lib/nexthop.c +++ b/lib/nexthop.c @@ -173,7 +173,7 @@ static int _nexthop_cmp_no_labels(const struct nexthop *next1,  		ret = _nexthop_gateway_cmp(next1, next2);  		if (ret != 0)  			return ret; -		/* Intentional Fall-Through */ +		fallthrough;  	case NEXTHOP_TYPE_IFINDEX:  		if (next1->ifindex < next2->ifindex)  			return -1; @@ -295,7 +295,7 @@ int nexthop_cmp_basic(const struct nexthop *nh1,  		ret = nexthop_g_addr_cmp(nh1->type, &nh1->gate, &nh2->gate);  		if (ret != 0)  			return ret; -		/* Intentional Fall-Through */ +		fallthrough;  	case NEXTHOP_TYPE_IFINDEX:  		if (nh1->ifindex < nh2->ifindex)  			return -1; diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c index 25370eba48..c75ff7b4cd 100644 --- a/lib/nexthop_group.c +++ b/lib/nexthop_group.c @@ -180,7 +180,7 @@ static struct nexthop *nhg_nh_find(const struct nexthop_group *nhg,  						 &nexthop->gate, &nh->gate);  			if (ret != 0)  				continue; -			/* Intentional Fall-Through */ +			fallthrough;  		case NEXTHOP_TYPE_IFINDEX:  			if (nexthop->ifindex != nh->ifindex)  				continue; diff --git a/lib/printf/printf-pos.c b/lib/printf/printf-pos.c index ac775bea4e..b2ba1a714d 100644 --- a/lib/printf/printf-pos.c +++ b/lib/printf/printf-pos.c @@ -355,7 +355,7 @@ reswitch:	switch (ch) {  			goto rflag;  		case 'C':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 'c':  			error = addtype(&types,  					(flags & LONGINT) ? T_WINT : T_INT); @@ -364,7 +364,7 @@ reswitch:	switch (ch) {  			break;  		case 'D':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 'd':  		case 'i':  			if ((error = addsarg(&types, flags))) @@ -408,7 +408,7 @@ reswitch:	switch (ch) {  #endif  		case 'O':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 'o':  			if ((error = adduarg(&types, flags)))  				goto error; @@ -419,7 +419,7 @@ reswitch:	switch (ch) {  			break;  		case 'S':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 's':  			error = addtype(&types,  					(flags & LONGINT) ? TP_WCHAR : TP_CHAR); @@ -428,7 +428,7 @@ reswitch:	switch (ch) {  			break;  		case 'U':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 'u':  		case 'X':  		case 'x': @@ -549,7 +549,7 @@ reswitch:	switch (ch) {  			goto rflag;  		case 'C':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 'c':  			error = addtype(&types,  					(flags & LONGINT) ? T_WINT : T_INT); @@ -558,7 +558,7 @@ reswitch:	switch (ch) {  			break;  		case 'D':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 'd':  		case 'i':  			if ((error = addsarg(&types, flags))) @@ -602,7 +602,7 @@ reswitch:	switch (ch) {  #endif  		case 'O':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 'o':  			if ((error = adduarg(&types, flags)))  				goto error; @@ -613,7 +613,7 @@ reswitch:	switch (ch) {  			break;  		case 'S':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 's':  			error = addtype(&types,  			    (flags & LONGINT) ? TP_WCHAR : TP_CHAR); @@ -622,7 +622,7 @@ reswitch:	switch (ch) {  			break;  		case 'U':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 'u':  		case 'X':  		case 'x': diff --git a/lib/printf/vfprintf.c b/lib/printf/vfprintf.c index 78f8be05cb..2083642d5e 100644 --- a/lib/printf/vfprintf.c +++ b/lib/printf/vfprintf.c @@ -340,7 +340,7 @@ reswitch:	switch (ch) {  			if (width >= 0)  				goto rflag;  			width = -width; -			/* FALLTHROUGH */ +			fallthrough;  		case '-':  			flags |= LADJUST;  			goto rflag; @@ -434,7 +434,7 @@ reswitch:	switch (ch) {  			break;  		case 'C':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 'c':  #ifdef WCHAR_SUPPORT  			if (flags & LONGINT) { @@ -460,7 +460,7 @@ reswitch:	switch (ch) {  			break;  		case 'D':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 'd':  		case 'i':  			if (flags & INTMAX_SIZE) @@ -551,7 +551,7 @@ reswitch:	switch (ch) {  			break;  		case 'O':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 'o':  			if (flags & INTMAX_SIZE)  				ujval = UJARG(); @@ -595,7 +595,7 @@ reswitch:	switch (ch) {  			goto nosign;  		case 'S':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 's':  #ifdef WCHAR_SUPPORT  			if (flags & LONGINT) { @@ -621,7 +621,7 @@ reswitch:	switch (ch) {  			break;  		case 'U':  			flags |= LONGINT; -			/*FALLTHROUGH*/ +			fallthrough;  		case 'u':  			if (flags & INTMAX_SIZE)  				ujval = UJARG(); diff --git a/lib/routemap_northbound.c b/lib/routemap_northbound.c index 5767e0aacf..9e25d2beb2 100644 --- a/lib/routemap_northbound.c +++ b/lib/routemap_northbound.c @@ -364,7 +364,6 @@ lib_route_map_entry_exit_policy_modify(struct nb_cb_modify_args *args)  		case 0: /* permit-or-deny */  			break;  		case 1: /* next */ -			/* FALLTHROUGH */  		case 2: /* goto */  			rm_action =  				yang_dnode_get_enum(args->dnode, "../action"); @@ -885,7 +884,7 @@ static int lib_route_map_entry_set_action_ipv4_address_modify(  		yang_dnode_get_ipv4(&ia, args->dnode, NULL);  		if (ia.s_addr == INADDR_ANY || !ipv4_unicast_valid(&ia))  			return NB_ERR_VALIDATION; -		/* FALLTHROUGH */ +		return NB_OK;  	case NB_EV_PREPARE:  	case NB_EV_ABORT:  		return NB_OK; @@ -944,7 +943,7 @@ static int lib_route_map_entry_set_action_ipv6_address_modify(  		yang_dnode_get_ipv6(&i6a, args->dnode, NULL);  		if (!IN6_IS_ADDR_LINKLOCAL(&i6a))  			return NB_ERR_VALIDATION; -		/* FALLTHROUGH */ +		return NB_OK;  	case NB_EV_PREPARE:  	case NB_EV_ABORT:  		return NB_OK; @@ -1565,7 +1565,7 @@ static void vty_read(struct event *thread)  			break;  		case '\r':  			vty->escape = VTY_CR; -			/* fallthru */ +			fallthrough;  		case '\n':  			vty_out(vty, "\n");  			buffer_flush_available(vty->obuf, vty->wfd); diff --git a/lib/workqueue.c b/lib/workqueue.c index fa5d585360..2281c4c369 100644 --- a/lib/workqueue.c +++ b/lib/workqueue.c @@ -271,9 +271,10 @@ void work_queue_run(struct event *thread)  		switch (ret) {  		case WQ_QUEUE_BLOCKED: {  			/* decrement item->ran again, cause this isn't an item -			 * specific error, and fall through to WQ_RETRY_LATER +			 * specific error, and retry later  			 */  			item->ran--; +			goto stats;  		}  		case WQ_RETRY_LATER: {  			goto stats; @@ -296,9 +297,10 @@ void work_queue_run(struct event *thread)  			break;  		}  		case WQ_RETRY_NOW: -		/* a RETRY_NOW that gets here has exceeded max_tries, same as -		 * ERROR */ -		/* fallthru */ +			/* a RETRY_NOW that gets here has exceeded max_tries, same +			 * as ERROR +			 */ +			fallthrough;  		case WQ_SUCCESS:  		default: {  			work_queue_item_remove(wq, item); diff --git a/lib/zclient.c b/lib/zclient.c index f8f9cf7aba..47d6c5fbaf 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -891,7 +891,7 @@ static int zapi_nexthop_cmp_no_labels(const struct zapi_nexthop *next1,  					 &next2->gate);  		if (ret != 0)  			return ret; -		/* Intentional Fall-Through */ +		fallthrough;  	case NEXTHOP_TYPE_IFINDEX:  		if (next1->ifindex < next2->ifindex)  			return -1; diff --git a/lib/zlog_5424.c b/lib/zlog_5424.c index 9bc1c819a8..3049e4a849 100644 --- a/lib/zlog_5424.c +++ b/lib/zlog_5424.c @@ -913,7 +913,7 @@ static int zlog_5424_open(struct zlog_cfg_5424 *zcf, int sock_type)  		}  		flags = O_NONBLOCK; -		/* fallthru */ +		fallthrough;  	case ZLOG_5424_DST_FILE:  		if (!zcf->filename) diff --git a/nhrpd/nhrp_packet.c b/nhrpd/nhrp_packet.c index 9d0b30cfee..c6bd3bbbde 100644 --- a/nhrpd/nhrp_packet.c +++ b/nhrpd/nhrp_packet.c @@ -270,7 +270,7 @@ int nhrp_ext_reply(struct zbuf *zb, struct nhrp_packet_header *hdr,  	default:  		if (type & NHRP_EXTENSION_FLAG_COMPULSORY)  			goto err; -	/* fallthru */ +		fallthrough;  	case NHRP_EXTENSION_FORWARD_TRANSIT_NHS:  	case NHRP_EXTENSION_REVERSE_TRANSIT_NHS:  		/* Supported compulsory extensions, and any diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c index ffb6cf7506..9926dcaf53 100644 --- a/nhrpd/nhrp_peer.c +++ b/nhrpd/nhrp_peer.c @@ -139,7 +139,7 @@ static void nhrp_peer_ifp_notify(struct notifier_block *n, unsigned long cmd)  					   nhrp_peer_vc_notify);  			__nhrp_peer_check(p);  		} -		/* fallthru */ /* to post config update */ +		fallthrough; /* to post config update */  	case NOTIFY_INTERFACE_ADDRESS_CHANGED:  		notifier_call(&p->notifier_list, NOTIFY_PEER_IFCONFIG_CHANGED);  		break; @@ -1050,7 +1050,7 @@ static void nhrp_peer_forward(struct nhrp_peer *p,  				 * append our selves to the transit NHS list  				 */  				goto err; -		/* fallthru */ +			fallthrough;  		case NHRP_EXTENSION_RESPONDER_ADDRESS:  			/* Supported compulsory extensions, and any  			 * non-compulsory that is not explicitly handled, @@ -1220,7 +1220,7 @@ void nhrp_peer_recv(struct nhrp_peer *p, struct zbuf *zb)  				/* FIXME: send error-indication */  			}  		} -		/* fallthru */ /* FIXME: double check, is this correct? */ +		fallthrough; /* FIXME: double check, is this correct? */  	case NHRP_ROUTE_OFF_NBMA:  		if (packet_types[hdr->type].handler) {  			packet_types[hdr->type].handler(&pp); diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index 07da9a5ec1..7fbe08d30f 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -631,8 +631,8 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh,  					"Neighbor state is not ExStart, ignore");  			return;  		} -	/* else fall through to ExStart */ -	/* fallthru */ +		/* else fall through to ExStart */ +		fallthrough;  	case OSPF6_NEIGHBOR_EXSTART:  		/* if neighbor obeys us as our slave, schedule negotiation_done  		   and process LSA Headers. Otherwise, ignore this message */ @@ -650,8 +650,8 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh,  				  on->ospf6_if->interface->vrf->name, on->name);  			return;  		} -	/* fall through to exchange */ - +		/* fall through to exchange */ +		fallthrough;  	case OSPF6_NEIGHBOR_EXCHANGE:  		if (!memcmp(dbdesc, &on->dbdesc_last,  			    sizeof(struct ospf6_dbdesc))) { @@ -835,8 +835,8 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh,  					"Neighbor state is not ExStart, ignore");  			return;  		} -	/* else fall through to ExStart */ -	/* fallthru */ +		/* else fall through to ExStart */ +		fallthrough;  	case OSPF6_NEIGHBOR_EXSTART:  		/* If the neighbor is Master, act as Slave. Schedule  		   negotiation_done diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index 443032933d..ca026dc97f 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -363,7 +363,7 @@ void ospf6_route_zebra_copy_nexthops(struct ospf6_route *route,  			case NEXTHOP_TYPE_IPV6_IFINDEX:  				nexthops[i].ifindex = nh->ifindex; -				/* FALLTHROUGH */ +				fallthrough;  			case NEXTHOP_TYPE_IPV6:  				nexthops[i].gate.ipv6 = nh->address;  				break; diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h index c2125951ec..2c1d17efc3 100644 --- a/ospf6d/ospf6_route.h +++ b/ospf6d/ospf6_route.h @@ -67,7 +67,7 @@ static inline bool ospf6_nexthop_is_same(const struct ospf6_nexthop *nha,  	case NEXTHOP_TYPE_IPV6_IFINDEX:  		if (nha->ifindex != nhb->ifindex)  			return false; -		/* FALLTHROUGH */ +		fallthrough;  	case NEXTHOP_TYPE_IPV6:  		if (!IN6_ARE_ADDR_EQUAL(&nha->address, &nhb->address))  			return false; diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c index f88667bfd0..671291312a 100644 --- a/ospf6d/ospf6_snmp.c +++ b/ospf6d/ospf6_snmp.c @@ -697,8 +697,8 @@ static uint8_t *ospfv3GeneralGroup(struct variable *v, oid *name,  	case OSPFv3REFERENCEBANDWIDTH:  		if (ospf6)  			return SNMP_INTEGER(ospf6->ref_bandwidth); -	/* Otherwise, like for "not implemented". */ -	/* fallthru */ +		/* Otherwise, like for "not implemented". */ +		return NULL;  	case OSPFv3RESTARTSUPPORT:  	case OSPFv3RESTARTINTERVAL:  	case OSPFv3RESTARTSTRICTLSACHECKING: diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c index dd8c9268f1..95a593ad4d 100644 --- a/ospfd/ospf_flood.c +++ b/ospfd/ospf_flood.c @@ -954,7 +954,7 @@ int ospf_flood_through(struct ospf *ospf, struct ospf_neighbor *inbr,  		if (IS_DEBUG_OSPF_NSSA)  			zlog_debug("%s: LOCAL NSSA FLOOD of Type-7.", __func__); -	/* Fallthrough */ +		fallthrough;  	default:  		lsa_ack_flag = ospf_flood_through_area(lsa->area, inbr, lsa);  		break; diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index 7601419325..938d373d8b 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -1167,7 +1167,7 @@ static int ospf_vl_set_params(struct ospf_area *area,  				if (IS_DEBUG_OSPF_EVENT)  					zlog_debug(  						"found back link through VL"); -			/* fallthru */ +				fallthrough;  			case LSA_LINK_TYPE_TRANSIT:  			case LSA_LINK_TYPE_POINTOPOINT:  				if (!IPV4_ADDR_SAME(&vl_data->peer_addr, diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index e47f832728..f125fa93b1 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -3096,13 +3096,14 @@ struct ospf_lsa *ospf_lsa_install(struct ospf *ospf, struct ospf_interface *oi,  			/* Incoming "oi" for this LSA has set at LSUpd  			 * reception. */  		} -	/* Fallthrough */ +		fallthrough;  	case OSPF_OPAQUE_AREA_LSA:  	case OSPF_OPAQUE_AS_LSA:  		new = ospf_opaque_lsa_install(lsa, rt_recalc);  		break;  	case OSPF_AS_NSSA_LSA:  		new = ospf_external_lsa_install(ospf, lsa, rt_recalc); +		break;  	default: /* type-6,8,9....nothing special */  		break;  	} diff --git a/ospfd/ospf_nsm.c b/ospfd/ospf_nsm.c index bcbe028795..7c3f289e02 100644 --- a/ospfd/ospf_nsm.c +++ b/ospfd/ospf_nsm.c @@ -107,7 +107,7 @@ static void nsm_timer_set(struct ospf_neighbor *nbr)  	case NSM_Down:  		EVENT_OFF(nbr->t_inactivity);  		EVENT_OFF(nbr->t_hello_reply); -	/* fallthru */ +		fallthrough;  	case NSM_Attempt:  	case NSM_Init:  	case NSM_TwoWay: diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index b37efa3efa..4bf4ae9597 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -1042,7 +1042,7 @@ static void ospf_db_desc_proc(struct stream *s, struct ospf_interface *oi,  			/* Neighbour has a more recent LSA, we must request it  			 */  			ospf_ls_request_add(nbr, new); -		/* fallthru */ +			fallthrough;  		case 0:  			/* If we have a copy of this LSA, it's either less  			 * recent @@ -1231,7 +1231,7 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,  		   through to case ExStart below.  */  		if (nbr->state != NSM_ExStart)  			break; -	/* fallthru */ +		fallthrough;  	case NSM_ExStart:  		/* Initial DBD */  		if ((IS_SET_DD_ALL(dd->flags) == OSPF_DD_FLAG_ALL) @@ -1641,7 +1641,7 @@ static struct list *ospf_ls_upd_list_lsa(struct ospf_neighbor *nbr,  		case OSPF_OPAQUE_LINK_LSA:  			lsa->oi = oi; /* Remember incoming interface for  					 flooding control. */ -		/* Fallthrough */ +			fallthrough;  		default:  			lsa->area = oi->area;  			break; diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c index 4f7882fb22..b9d1ca9bb7 100644 --- a/pbrd/pbr_nht.c +++ b/pbrd/pbr_nht.c @@ -534,6 +534,7 @@ void pbr_nht_set_seq_nhg_data(struct pbr_map_sequence *pbrms,  	case NEXTHOP_TYPE_IPV4:  	case NEXTHOP_TYPE_IPV4_IFINDEX:  		pbrms->family = AF_INET; +		break;  	case NEXTHOP_TYPE_IFINDEX:  	case NEXTHOP_TYPE_BLACKHOLE:  		break; @@ -889,7 +890,7 @@ static void pbr_nht_individual_nexthop_update(struct pbr_nexthop_cache *pnhc,  			pbr_nht_individual_nexthop_interface_update(pnhc, pnhi);  			break;  		} -		/* Intentional fall thru */ +		fallthrough;  	case NEXTHOP_TYPE_IPV4_IFINDEX:  	case NEXTHOP_TYPE_IPV4:  	case NEXTHOP_TYPE_IPV6: diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c index 4e8e5f0df7..af36caec65 100644 --- a/pimd/pim_nht.c +++ b/pimd/pim_nht.c @@ -338,7 +338,7 @@ bool pim_nht_bsr_rpf_check(struct pim_instance *pim, pim_addr bsr_addr,  			if (nh->ifindex == IFINDEX_INTERNAL)  				continue; -			/* fallthru */ +			fallthrough;  		case NEXTHOP_TYPE_IPV4_IFINDEX:  			nhaddr = nh->gate.ipv4;  			break; @@ -350,7 +350,7 @@ bool pim_nht_bsr_rpf_check(struct pim_instance *pim, pim_addr bsr_addr,  			if (nh->ifindex == IFINDEX_INTERNAL)  				continue; -			/* fallthru */ +			fallthrough;  		case NEXTHOP_TYPE_IPV6_IFINDEX:  			nhaddr = nh->gate.ipv6;  			break; diff --git a/tests/bgpd/test_capability.c b/tests/bgpd/test_capability.c index 9d3d0ecbc1..38f896b30c 100644 --- a/tests/bgpd/test_capability.c +++ b/tests/bgpd/test_capability.c @@ -835,7 +835,7 @@ static void parse_test(struct peer *peer, struct test_segment *t, int type)  	switch (type) {  	case CAPABILITY:  		len += 2; /* to cover the OPT-Param header */ -		_FALLTHROUGH +		fallthrough;  	case OPT_PARAM:  		printf("len: %u\n", len);  		/* peek_for_as4 wants getp at capibility*/ diff --git a/tools/frr-llvm-cg.c b/tools/frr-llvm-cg.c index 3a7222e421..f366ba62f9 100644 --- a/tools/frr-llvm-cg.c +++ b/tools/frr-llvm-cg.c @@ -231,7 +231,7 @@ static void walk_const_fptrs(struct json_object *js_call, LLVMValueRef value,  				"%s: calls function pointer from unhandled const GEP\n",  				prefix);  			*hdr_written = true; -			/* fallthru */ +			fallthrough;  		default:  			/* to help the user / development */  			if (!*hdr_written) { diff --git a/watchfrr/watchfrr.c b/watchfrr/watchfrr.c index 89199da1af..34acf683ef 100644 --- a/watchfrr/watchfrr.c +++ b/watchfrr/watchfrr.c @@ -908,7 +908,7 @@ static void phase_check(void)  			"Phased restart: all routing daemon stop jobs have completed.");  		set_phase(PHASE_WAITING_DOWN); -	/*FALLTHRU*/ +		fallthrough;  	case PHASE_WAITING_DOWN:  		if (gs.numdown + IS_UP(gs.special) < gs.numdaemons)  			break; @@ -918,7 +918,7 @@ static void phase_check(void)  			1);  		set_phase(PHASE_ZEBRA_RESTART_PENDING); -	/*FALLTHRU*/ +		fallthrough;  	case PHASE_ZEBRA_RESTART_PENDING:  		if (gs.special->restart.pid)  			break; @@ -927,7 +927,7 @@ static void phase_check(void)  			  gs.special->name);  		set_phase(PHASE_WAITING_ZEBRA_UP); -	/*FALLTHRU*/ +		fallthrough;  	case PHASE_WAITING_ZEBRA_UP:  		if (!IS_UP(gs.special))  			break; diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c index 2a87925231..70bcfe4498 100644 --- a/zebra/dplane_fpm_nl.c +++ b/zebra/dplane_fpm_nl.c @@ -859,7 +859,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)  		if (op == DPLANE_OP_ROUTE_DELETE)  			break; -		/* FALL THROUGH */ +		fallthrough;  	case DPLANE_OP_ROUTE_INSTALL:  		rv = netlink_route_multipath_msg_encode(RTM_NEWROUTE, ctx,  							&nl_buf[nl_buf_len], diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index bfe1910a58..a5dec0458c 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -366,7 +366,8 @@ static inline int proto2zebra(int proto, int family, bool is_nexthop)  			proto = ZEBRA_ROUTE_NHG;  			break;  		} -		/* Intentional fall thru */ +		proto = ZEBRA_ROUTE_KERNEL; +		break;  	default:  		/*  		 * When a user adds a new protocol this will show up diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index eac4fcc8e0..c2e34faed6 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -1182,6 +1182,7 @@ static char *nhlfe2str(const struct zebra_nhlfe *nhlfe, char *buf, int size)  		break;  	case NEXTHOP_TYPE_IFINDEX:  		snprintf(buf, size, "Ifindex: %u", nexthop->ifindex); +		break;  	case NEXTHOP_TYPE_BLACKHOLE:  		break;  	} diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 1879bafcac..6517b7830b 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -1310,6 +1310,7 @@ int nhg_ctx_process(struct nhg_ctx *ctx)  		break;  	case NHG_CTX_OP_DEL:  		ret = nhg_ctx_process_del(ctx); +		break;  	case NHG_CTX_OP_NONE:  		break;  	} diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index c05d69a2dd..79f6ad484c 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -4082,7 +4082,6 @@ static void _route_entry_dump_nh(const struct route_entry *re,  			 ifp ? ifp->name : "Unknown");  		break;  	case NEXTHOP_TYPE_IPV4: -		/* fallthrough */  	case NEXTHOP_TYPE_IPV4_IFINDEX:  		inet_ntop(AF_INET, &nexthop->gate, nhname, INET6_ADDRSTRLEN);  		break; @@ -5043,7 +5042,7 @@ struct route_table *rib_tables_iter_next(rib_tables_iter_t *iter)  		iter->vrf_id = VRF_DEFAULT;  		iter->afi_safi_ix = -1; -	/* Fall through */ +		fallthrough;  	case RIB_TABLES_ITER_S_ITERATING:  		iter->afi_safi_ix++;  | 
