mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
build: add -Wimplicit-fallthrough
Also: - replace all /* fallthrough */ comments with portable fallthrough; pseudo keyword to accomodate both gcc and clang - add missing break; statements as required by older versions of gcc - cleanup some code to remove unnecessary fallthrough Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
9bc4d9eaec
commit
7d67b9ff28
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
13
lib/base64.c
13
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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
22
lib/jhash.c
22
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];
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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':
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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*/
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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++;
|
||||
|
|
Loading…
Reference in a new issue