]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: fix GCC 7 switch/case fallthrough warnings
authorDavid Lamparter <equinox@opensourcerouting.org>
Thu, 30 Nov 2017 03:40:16 +0000 (19:40 -0800)
committerMartin Winter <mwinter@opensourcerouting.org>
Tue, 5 Dec 2017 06:55:31 +0000 (22:55 -0800)
Need a comment on these.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
13 files changed:
bgpd/bgp_aspath.c
bgpd/bgp_fsm.c
bgpd/bgp_main.c
lib/command_match.c
lib/jhash.c
lib/workqueue.c
nhrpd/nhrp_packet.c
nhrpd/nhrp_peer.c
ospf6d/ospf6_message.c
ospf6d/ospf6_snmp.c
ospfd/ospf_interface.c
ospfd/ospf_nsm.c
ospfd/ospf_packet.c

index 365c2fee4045e5a5454583d59bb78de2ced64382..b07d9ff3c60b19f198d61d3b3f56380c16082a82 100644 (file)
@@ -1685,6 +1685,7 @@ struct aspath *aspath_reconcile_as4(struct aspath *aspath,
                                                " across 2/4 ASN boundary somewhere, broken..");
                                hops = seg->length;
                        }
+                       /* fallthru */
                case AS_SEQUENCE:
                        cpasns = MIN(seg->length, hops);
                        hops -= seg->length;
index 5e117d76723163193484ce50fe3f5b5f31a0c63b..dcaea737a496c46226c8621c34f6ea358c9ed874 100644 (file)
@@ -338,6 +338,7 @@ void bgp_timer_set(struct peer *peer)
                BGP_TIMER_OFF(peer->t_gr_restart);
                BGP_TIMER_OFF(peer->t_gr_stale);
                BGP_TIMER_OFF(peer->t_pmax_restart);
+               /* fallthru */
        case Clearing:
                BGP_TIMER_OFF(peer->t_start);
                BGP_TIMER_OFF(peer->t_connect);
index 79a294bd4f98a044e268de57071c5fbde1453d40..29b59c432921e3630fc6fe613c780284182b5694 100644 (file)
@@ -387,7 +387,8 @@ int main(int argc, char **argv)
                        break;
                case 'l':
                        bgp_address = optarg;
-               /* listenon implies -n */
+                       /* listenon implies -n */
+                       /* fallthru */
                case 'n':
                        no_fib_flag = 1;
                        break;
index 24e850ad2e8cb146e032d42aca52085fe9a2d132..31b351e3f6b8186cdf1556089dedb9bbce475ed5 100644 (file)
@@ -403,6 +403,7 @@ enum matcher_rv command_complete(struct graph *graph, vector vline,
                                trace_matcher("trivial_match\n");
                                if (exact_match_exists && !last_token)
                                        break;
+                               /* fallthru */
                        case exact_match:
                                trace_matcher("exact_match\n");
                                if (last_token) {
index 8b646b8e2d1a956f0bd38f2733c3aafcdde73c1a..729b74386c4773f1113eea3309d8213eb052ea64 100644 (file)
@@ -86,24 +86,34 @@ u_int32_t jhash(const void *key, u_int32_t length, u_int32_t initval)
        switch (len) {
        case 11:
                c += ((u_int32_t)k[10] << 24);
+               /* fallthru */
        case 10:
                c += ((u_int32_t)k[9] << 16);
+               /* fallthru */
        case 9:
                c += ((u_int32_t)k[8] << 8);
+               /* fallthru */
        case 8:
                b += ((u_int32_t)k[7] << 24);
+               /* fallthru */
        case 7:
                b += ((u_int32_t)k[6] << 16);
+               /* fallthru */
        case 6:
                b += ((u_int32_t)k[5] << 8);
+               /* fallthru */
        case 5:
                b += k[4];
+               /* fallthru */
        case 4:
                a += ((u_int32_t)k[3] << 24);
+               /* fallthru */
        case 3:
                a += ((u_int32_t)k[2] << 16);
+               /* fallthru */
        case 2:
                a += ((u_int32_t)k[1] << 8);
+               /* fallthru */
        case 1:
                a += k[0];
        };
@@ -138,6 +148,7 @@ u_int32_t jhash2(const u_int32_t *k, u_int32_t length, u_int32_t initval)
        switch (len) {
        case 2:
                b += k[1];
+               /* fallthru */
        case 1:
                a += k[0];
        };
index 1789c6b7dbc163636bf94a2842712db4e3abfcf7..118bfced5e8afccccbd861d8a9eed0eb159c171c 100644 (file)
@@ -320,7 +320,7 @@ int work_queue_run(struct thread *thread)
                        if (wq->spec.errorfunc)
                                wq->spec.errorfunc(wq, item);
                }
-               /* fall through here is deliberate */
+               /* fallthru */
                case WQ_SUCCESS:
                default: {
                        work_queue_item_remove(wq, node);
index 36dbdfd7772d1589dfa88884b22c3d1ed5b3b2e5..0ba3f33d05682828580ef244eb689c7d057e2f59 100644 (file)
@@ -244,6 +244,7 @@ int nhrp_ext_reply(struct zbuf *zb, struct nhrp_packet_header *hdr, struct inter
        default:
                if (type & NHRP_EXTENSION_FLAG_COMPULSORY)
                        goto err;
+               /* fallthru */
        case NHRP_EXTENSION_FORWARD_TRANSIT_NHS:
        case NHRP_EXTENSION_REVERSE_TRANSIT_NHS:
                /* Supported compulsory extensions, and any
index 3cc91a90832886483017a414b666482c502d081d..06d48a2d1225f8d57ea7d236a4f089569a7e0650 100644 (file)
@@ -134,7 +134,7 @@ static void nhrp_peer_ifp_notify(struct notifier_block *n, unsigned long cmd)
                        nhrp_vc_notify_add(p->vc, &p->vc_notifier, nhrp_peer_vc_notify);
                        __nhrp_peer_check(p);
                }
-               /* Fall-through to post config update */
+               /* fallthru */
        case NOTIFY_INTERFACE_ADDRESS_CHANGED:
                notifier_call(&p->notifier_list, NOTIFY_PEER_IFCONFIG_CHANGED);
                break;
@@ -687,6 +687,7 @@ static void nhrp_peer_forward(struct nhrp_peer *p, struct nhrp_packet_parser *pp
                                /* FIXME: RFC says to just copy, but not
                                 * append our selves to the transit NHS list */
                                goto err;
+                       /* fallthru */
                case NHRP_EXTENSION_RESPONDER_ADDRESS:
                        /* Supported compulsory extensions, and any
                         * non-compulsory that is not explicitly handled,
@@ -849,6 +850,7 @@ void nhrp_peer_recv(struct nhrp_peer *p, struct zbuf *zb)
                                /* FIXME: send error-indication */
                        }
                }
+               /* fallthru */
        case NHRP_ROUTE_OFF_NBMA:
                if (packet_types[hdr->type].handler) {
                        packet_types[hdr->type].handler(&pp);
index 93c85b58de1a4170ecc5be6eb1ccc32f2b74ea59..3da455e79da48917f4e94b03d2a5d787c3e2e352 100644 (file)
@@ -369,7 +369,7 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh,
                        return;
                }
        /* else fall through to ExStart */
-
+       /* fallthru */
        case OSPF6_NEIGHBOR_EXSTART:
                /* if neighbor obeys us as our slave, schedule negotiation_done
                   and process LSA Headers. Otherwise, ignore this message */
@@ -565,7 +565,7 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh,
                        return;
                }
        /* else fall through to ExStart */
-
+       /* fallthru */
        case OSPF6_NEIGHBOR_EXSTART:
                /* If the neighbor is Master, act as Slave. Schedule
                   negotiation_done
index 3affa12a92dd76731b3bd7b0d99ef47ea74723bf..e7b93b638636ad58225bb93f6edb844c93a3efbe 100644 (file)
@@ -712,7 +712,8 @@ static u_char *ospfv3GeneralGroup(struct variable *v, oid *name, size_t *length,
        case OSPFv3REFERENCEBANDWIDTH:
                if (ospf6)
                        return SNMP_INTEGER(ospf6->ref_bandwidth);
-       /* Otherwise, like for "not implemented". */
+               /* Otherwise, like for "not implemented". */
+               /* fallthru */
        case OSPFv3RESTARTSUPPORT:
        case OSPFv3RESTARTINTERVAL:
        case OSPFv3RESTARTSTRICTLSACHECKING:
index ad501f6881c41d626e104c0670e1e1360e9a077e..24fe8ac726a79790474c0506a166c2a75bc5092a 100644 (file)
@@ -988,6 +988,7 @@ static int ospf_vl_set_params(struct ospf_vl_data *vl_data, struct vertex *v)
                                if (IS_DEBUG_OSPF_EVENT)
                                        zlog_debug(
                                                "found back link through VL");
+                               /* fallthru */
                        case LSA_LINK_TYPE_TRANSIT:
                        case LSA_LINK_TYPE_POINTOPOINT:
                                if (!IPV4_ADDR_SAME(&vl_data->peer_addr,
index a112f7095a3ab2603fc5ee476447550903df19d1..201e725cf6fab8e4d38c14ae19dcf62fd4c52763 100644 (file)
@@ -110,6 +110,7 @@ static void nsm_timer_set(struct ospf_neighbor *nbr)
        case NSM_Down:
                OSPF_NSM_TIMER_OFF(nbr->t_inactivity);
                OSPF_NSM_TIMER_OFF(nbr->t_hello_reply);
+               /* fallthru */
        case NSM_Attempt:
        case NSM_Init:
        case NSM_TwoWay:
index df7bac4db85e201b13c784aa19b1d2d45e6981f2..a0393652aff576ed569cc6ba3bda17f4e51cc4be 100644 (file)
@@ -1129,6 +1129,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 */
                case 0:
                        /* If we have a copy of this LSA, it's either less
                         * recent
@@ -1310,6 +1311,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 */
        case NSM_ExStart:
                /* Initial DBD */
                if ((IS_SET_DD_ALL(dd->flags) == OSPF_DD_FLAG_ALL)