]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: fix GCC 7 switch/case fallthrough warnings
authorDavid Lamparter <equinox@opensourcerouting.org>
Fri, 14 Jul 2017 14:48:01 +0000 (16:48 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Fri, 14 Jul 2017 14:59:43 +0000 (16:59 +0200)
Need a comment on these.

Signed-off-by: David Lamparter <equinox@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 95257493b56b359413685cf8440a1cfdd80e977d..47bbfd466abbde1741350f175785b0811ab8003a 100644 (file)
@@ -1764,6 +1764,7 @@ aspath_reconcile_as4 ( struct aspath *aspath, struct aspath *as4path)
                              " across 2/4 ASN boundary somewhere, broken..");
                hops = seg->length;
              }
+            /* fallthru */
          case AS_SEQUENCE:
            cpasns = MIN(seg->length, hops);
            hops -= seg->length;
index 1fc425f8f5b3fe567d7d8a5770af41a262a74efc..3610e6309dc262e748de6f032c39ebe9818482a6 100644 (file)
@@ -350,6 +350,7 @@ 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 b4d71f78d2a36843c2a1848b63960a4a898f0a17..7841d510b0d06e8f2e3b8b53d2bae85b47344878 100644 (file)
@@ -399,6 +399,7 @@ main (int argc, char **argv)
        case 'l':
          bgp_address = optarg;
          /* listenon implies -n */
+          /* fallthru */
        case 'n':
           no_fib_flag = 1;
          break;
index 75d8fdc3d3e24121ebd56f2a63f34c4bb82435d6..5a57bb91914775724d1e0adeed6ac89d4c8bcdb6 100644 (file)
@@ -403,6 +403,7 @@ command_complete (struct graph *graph,
                 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 6154c34630face49976fc93fc6af771954c7fce3..33589b64e2c2d547247ce9081733213b988edb2b 100644 (file)
@@ -74,24 +74,34 @@ jhash (const void *key, u_int32_t length, u_int32_t initval)
     {
     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];
     };
@@ -129,6 +139,7 @@ jhash2 (const u_int32_t *k, u_int32_t length, u_int32_t initval)
     {
     case 2:
       b += k[1];
+      /* fallthru */
     case 1:
       a += k[0];
     };
index 3600df2f2300c865f2d0ff52fb46d07248d7d37b..60119f1f418808f370f3a672507f4ac1fb365877 100644 (file)
@@ -331,14 +331,14 @@ work_queue_run (struct thread *thread)
        {
          item->ran--;
          work_queue_item_requeue (wq, node);
-      /* If a single node is being used with a meta-queue (e.g., zebra),
-       * update the next node as we don't want to exit the thread and
-       * reschedule it after every node. By definition, WQ_REQUEUE is
-       * meant to continue the processing; the yield logic will kick in
-       * to terminate the thread when time has exceeded.
-       */
-      if (nnode == NULL)
-        nnode = node;
+          /* If a single node is being used with a meta-queue (e.g., zebra),
+           * update the next node as we don't want to exit the thread and
+           * reschedule it after every node. By definition, WQ_REQUEUE is
+           * meant to continue the processing; the yield logic will kick in
+           * to terminate the thread when time has exceeded.
+           */
+          if (nnode == NULL)
+            nnode = node;
          break;
        }
       case WQ_RETRY_NOW:
@@ -348,7 +348,7 @@ 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:
        {
index 76c5f15170f00b403a1615df3dd584beed56bba4..36281d517271f22c87bac4fd2c3583d8f836fe7a 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 95541b88b640ab22fca8d55f094ed55f16610a9d..f1cf62a598f64bb167329a2f950e7041ae547644 100644 (file)
@@ -133,7 +133,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 */ /* to post config update */
        case NOTIFY_INTERFACE_ADDRESS_CHANGED:
                notifier_call(&p->notifier_list, NOTIFY_PEER_IFCONFIG_CHANGED);
                break;
@@ -693,6 +693,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,
@@ -855,6 +856,7 @@ void nhrp_peer_recv(struct nhrp_peer *p, struct zbuf *zb)
                                /* FIXME: send error-indication */
                        }
                }
+               /* fallthru */ /* FIXME: double check, is this correct? */
        case NHRP_ROUTE_OFF_NBMA:
                if (packet_types[hdr->type].handler) {
                        packet_types[hdr->type].handler(&pp);
index 5924afc38f2b51f7df007163ac0e6fd1bebf41ef..1f94fde82f297d45a87bc300f002f2762fefebb6 100644 (file)
@@ -392,7 +392,7 @@ 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 */
@@ -600,7 +600,7 @@ 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
          and process LSA Headers. Otherwise, ignore this message */
index b30d3efb062e6565a835995095c8a0a70a46f55d..b852189d0fdbbad19a1e2baea09e96144cf72d29 100644 (file)
@@ -493,6 +493,7 @@ ospfv3GeneralGroup (struct variable *v, oid *name, size_t *length,
       if (ospf6)
         return SNMP_INTEGER (ospf6->ref_bandwidth);
       /* Otherwise, like for "not implemented". */
+      /* fallthru */
     case OSPFv3RESTARTSUPPORT:
     case OSPFv3RESTARTINTERVAL:
     case OSPFv3RESTARTSTRICTLSACHECKING:
index c09092e81a23a6d4e10e530be3c0e1bad705ae39..1e95e43122c6727d662dcf22752003ecad712ca1 100644 (file)
@@ -1033,6 +1033,7 @@ ospf_vl_set_params (struct ospf_vl_data *vl_data, struct vertex *v)
               case LSA_LINK_TYPE_VIRTUALLINK:
                 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 d5c41802ed1cc54d8d1d98e25f6d73848ca50afa..676069d6edd4e79e5adb61b9dfcaf3693780aa6f 100644 (file)
@@ -113,6 +113,7 @@ 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 f33e0338acf0bfc6f9efc2542ecd4c48027cb86f..951304c4d1d6783287206fc41dde5f9254eafb16 100644 (file)
@@ -1152,6 +1152,7 @@ ospf_db_desc_proc (struct stream *s, struct ospf_interface *oi,
           case -1:
             /* 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
              * and we're requesting it from neighbour (the case above), or
@@ -1327,6 +1328,7 @@ 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) &&