]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Add missing enums to switch statements
authorDonald Sharp <sharpd@nvidia.com>
Mon, 30 Jan 2023 15:05:58 +0000 (10:05 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Tue, 31 Jan 2023 20:15:42 +0000 (15:15 -0500)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 files changed:
zebra/connected.c
zebra/if_netlink.c
zebra/kernel_socket.c
zebra/router-id.c
zebra/rt_netlink.c
zebra/tc_netlink.c
zebra/zapi_msg.c
zebra/zebra_fpm.c
zebra/zebra_fpm_netlink.c
zebra/zebra_fpm_protobuf.c
zebra/zebra_mlag.c
zebra/zebra_mpls.c
zebra/zebra_mpls_openbsd.c
zebra/zebra_nb_state.c
zebra/zebra_nhg.c
zebra/zebra_pbr.c
zebra/zebra_rib.c
zebra/zebra_rnh.c
zebra/zebra_routemap.c
zebra/zebra_srte.c
zebra/zebra_vty.c

index c01be58e826813582fac3ceeadafa9eae6357a49..9c207acf341ea000760357a5c4b7d17266c6656a 100644 (file)
@@ -247,7 +247,9 @@ void connected_up(struct interface *ifp, struct connected *ifc)
                        return;
 #endif
                break;
-       default:
+       case AFI_UNSPEC:
+       case AFI_L2VPN:
+       case AFI_MAX:
                flog_warn(EC_ZEBRA_CONNECTED_AFI_UNKNOWN,
                          "Received unknown AFI: %s", afi2str(afi));
                return;
@@ -435,7 +437,9 @@ void connected_down(struct interface *ifp, struct connected *ifc)
                if (IN6_IS_ADDR_UNSPECIFIED(&p.u.prefix6))
                        return;
                break;
-       default:
+       case AFI_UNSPEC:
+       case AFI_L2VPN:
+       case AFI_MAX:
                zlog_warn("Unknown AFI: %s", afi2str(afi));
                break;
        }
index d628e47492a845ff41ea0f2b725995ce2c7a142d..835659332b3f9500b93594b179a6ffbd4c854f3e 100644 (file)
@@ -1362,7 +1362,57 @@ static ssize_t netlink_intf_msg_encoder(struct zebra_dplane_ctx *ctx, void *buf,
        case DPLANE_OP_INTF_DELETE:
                cmd = RTM_DELLINK;
                break;
-       default:
+       case DPLANE_OP_NONE:
+       case DPLANE_OP_ROUTE_INSTALL:
+       case DPLANE_OP_ROUTE_UPDATE:
+       case DPLANE_OP_ROUTE_DELETE:
+       case DPLANE_OP_ROUTE_NOTIFY:
+       case DPLANE_OP_NH_INSTALL:
+       case DPLANE_OP_NH_UPDATE:
+       case DPLANE_OP_NH_DELETE:
+       case DPLANE_OP_LSP_INSTALL:
+       case DPLANE_OP_LSP_DELETE:
+       case DPLANE_OP_LSP_NOTIFY:
+       case DPLANE_OP_LSP_UPDATE:
+       case DPLANE_OP_PW_INSTALL:
+       case DPLANE_OP_PW_UNINSTALL:
+       case DPLANE_OP_SYS_ROUTE_ADD:
+       case DPLANE_OP_SYS_ROUTE_DELETE:
+       case DPLANE_OP_ADDR_INSTALL:
+       case DPLANE_OP_ADDR_UNINSTALL:
+       case DPLANE_OP_MAC_INSTALL:
+       case DPLANE_OP_MAC_DELETE:
+       case DPLANE_OP_NEIGH_INSTALL:
+       case DPLANE_OP_NEIGH_UPDATE:
+       case DPLANE_OP_NEIGH_DELETE:
+       case DPLANE_OP_NEIGH_DISCOVER:
+       case DPLANE_OP_VTEP_ADD:
+       case DPLANE_OP_VTEP_DELETE:
+       case DPLANE_OP_RULE_ADD:
+       case DPLANE_OP_RULE_DELETE:
+       case DPLANE_OP_RULE_UPDATE:
+       case DPLANE_OP_BR_PORT_UPDATE:
+       case DPLANE_OP_IPTABLE_ADD:
+       case DPLANE_OP_IPTABLE_DELETE:
+       case DPLANE_OP_IPSET_ADD:
+       case DPLANE_OP_IPSET_ENTRY_ADD:
+       case DPLANE_OP_IPSET_ENTRY_DELETE:
+       case DPLANE_OP_IPSET_DELETE:
+       case DPLANE_OP_NEIGH_IP_INSTALL:
+       case DPLANE_OP_NEIGH_IP_DELETE:
+       case DPLANE_OP_NEIGH_TABLE_UPDATE:
+       case DPLANE_OP_GRE_SET:
+       case DPLANE_OP_INTF_ADDR_ADD:
+       case DPLANE_OP_INTF_ADDR_DEL:
+       case DPLANE_OP_INTF_NETCONFIG:
+       case DPLANE_OP_TC_QDISC_INSTALL:
+       case DPLANE_OP_TC_QDISC_UNINSTALL:
+       case DPLANE_OP_TC_CLASS_ADD:
+       case DPLANE_OP_TC_CLASS_DELETE:
+       case DPLANE_OP_TC_CLASS_UPDATE:
+       case DPLANE_OP_TC_FILTER_ADD:
+       case DPLANE_OP_TC_FILTER_DELETE:
+       case DPLANE_OP_TC_FILTER_UPDATE:
                flog_err(
                        EC_ZEBRA_NHG_FIB_UPDATE,
                        "Context received for kernel interface update with incorrect OP code (%u)",
index 684ccc3ed5481516338668a35c50a8ce44c84b01..332b8fc674ae09cdc080f1fd2afe1725991c0002 100644 (file)
@@ -1226,7 +1226,8 @@ int rtm_write(int message, union sockunion *dest, union sockunion *mask,
        case BLACKHOLE_REJECT:
                msg.rtm.rtm_flags |= RTF_REJECT;
                break;
-       default:
+       case BLACKHOLE_NULL:
+       case BLACKHOLE_ADMINPROHIB:
                msg.rtm.rtm_flags |= RTF_BLACKHOLE;
                break;
        }
index 9f56cf0e6af93824e75da2475a39d6f47c11b4a9..ea429f683ad1be74703a135262c904c420514bdd 100644 (file)
@@ -113,9 +113,13 @@ int router_id_get(afi_t afi, struct prefix *p, struct zebra_vrf *zvrf)
                if (addr)
                        memcpy(&p->u.prefix6, addr, sizeof(struct in6_addr));
                return 0;
-       default:
+       case AFI_UNSPEC:
+       case AFI_L2VPN:
+       case AFI_MAX:
                return -1;
        }
+
+       assert(!"Reached end of function we should never hit");
 }
 
 static int router_id_set(afi_t afi, struct prefix *p, struct zebra_vrf *zvrf)
@@ -133,7 +137,9 @@ static int router_id_set(afi_t afi, struct prefix *p, struct zebra_vrf *zvrf)
        case AFI_IP6:
                zvrf->rid6_user_assigned.u.prefix6 = p->u.prefix6;
                break;
-       default:
+       case AFI_UNSPEC:
+       case AFI_L2VPN:
+       case AFI_MAX:
                return -1;
        }
 
index 79d79d74be65d425fa72950766308cf76c4cc414..216b719ff859526923412e83cc65155c0f41edfb 100644 (file)
@@ -1569,7 +1569,16 @@ static bool _netlink_route_build_singlepath(const struct prefix *p,
                                                   ctx->table))
                                        return false;
                                break;
-                       default:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_DX2:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_DX6:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_B6:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_B6_ENCAP:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_BM:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_S:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_AS:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_AM:
+                       case ZEBRA_SEG6_LOCAL_ACTION_END_BPF:
+                       case ZEBRA_SEG6_LOCAL_ACTION_UNSPEC:
                                zlog_err("%s: unsupport seg6local behaviour action=%u",
                                         __func__,
                                         nexthop->nh_srv6->seg6local_action);
@@ -2151,7 +2160,8 @@ ssize_t netlink_route_multipath_msg_encode(int cmd,
                        case BLACKHOLE_REJECT:
                                req->r.rtm_type = RTN_UNREACHABLE;
                                break;
-                       default:
+                       case BLACKHOLE_UNSPEC:
+                       case BLACKHOLE_NULL:
                                req->r.rtm_type = RTN_BLACKHOLE;
                                break;
                        }
@@ -4448,7 +4458,7 @@ static int netlink_neigh_table_update_ctx(const struct zebra_dplane_ctx *ctx,
 static ssize_t netlink_neigh_msg_encoder(struct zebra_dplane_ctx *ctx,
                                         void *buf, size_t buflen)
 {
-       ssize_t ret;
+       ssize_t ret = 0;
 
        switch (dplane_ctx_get_op(ctx)) {
        case DPLANE_OP_NEIGH_INSTALL:
@@ -4472,7 +4482,51 @@ static ssize_t netlink_neigh_msg_encoder(struct zebra_dplane_ctx *ctx,
        case DPLANE_OP_NEIGH_TABLE_UPDATE:
                ret = netlink_neigh_table_update_ctx(ctx, buf, buflen);
                break;
-       default:
+       case DPLANE_OP_ROUTE_INSTALL:
+       case DPLANE_OP_ROUTE_UPDATE:
+       case DPLANE_OP_ROUTE_DELETE:
+       case DPLANE_OP_ROUTE_NOTIFY:
+       case DPLANE_OP_NH_INSTALL:
+       case DPLANE_OP_NH_UPDATE:
+       case DPLANE_OP_NH_DELETE:
+       case DPLANE_OP_LSP_INSTALL:
+       case DPLANE_OP_LSP_UPDATE:
+       case DPLANE_OP_LSP_DELETE:
+       case DPLANE_OP_LSP_NOTIFY:
+       case DPLANE_OP_PW_INSTALL:
+       case DPLANE_OP_PW_UNINSTALL:
+       case DPLANE_OP_SYS_ROUTE_ADD:
+       case DPLANE_OP_SYS_ROUTE_DELETE:
+       case DPLANE_OP_ADDR_INSTALL:
+       case DPLANE_OP_ADDR_UNINSTALL:
+       case DPLANE_OP_MAC_INSTALL:
+       case DPLANE_OP_MAC_DELETE:
+       case DPLANE_OP_RULE_ADD:
+       case DPLANE_OP_RULE_DELETE:
+       case DPLANE_OP_RULE_UPDATE:
+       case DPLANE_OP_BR_PORT_UPDATE:
+       case DPLANE_OP_IPTABLE_ADD:
+       case DPLANE_OP_IPTABLE_DELETE:
+       case DPLANE_OP_IPSET_ADD:
+       case DPLANE_OP_IPSET_DELETE:
+       case DPLANE_OP_IPSET_ENTRY_ADD:
+       case DPLANE_OP_IPSET_ENTRY_DELETE:
+       case DPLANE_OP_GRE_SET:
+       case DPLANE_OP_INTF_ADDR_ADD:
+       case DPLANE_OP_INTF_ADDR_DEL:
+       case DPLANE_OP_INTF_NETCONFIG:
+       case DPLANE_OP_INTF_INSTALL:
+       case DPLANE_OP_INTF_UPDATE:
+       case DPLANE_OP_INTF_DELETE:
+       case DPLANE_OP_TC_QDISC_INSTALL:
+       case DPLANE_OP_TC_QDISC_UNINSTALL:
+       case DPLANE_OP_TC_CLASS_ADD:
+       case DPLANE_OP_TC_CLASS_DELETE:
+       case DPLANE_OP_TC_CLASS_UPDATE:
+       case DPLANE_OP_TC_FILTER_ADD:
+       case DPLANE_OP_TC_FILTER_DELETE:
+       case DPLANE_OP_TC_FILTER_UPDATE:
+       case DPLANE_OP_NONE:
                ret = -1;
        }
 
index 1fa80e846a988a5aef6734e69b44ff5a4231b0c4..757dc1d34376c8eb36a68b4567d2fac23e0e03cb 100644 (file)
@@ -745,7 +745,8 @@ int netlink_qdisc_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
        case TC_QDISC_NOQUEUE:
                /* "noqueue" is the default qdisc */
                break;
-       default:
+       case TC_QDISC_HTB:
+       case TC_QDISC_UNSPEC:
                break;
        }
 
index a2233a6667a0e8c6fe58482904fe929263956805..fdea766a1b2f179320992f0699741686db6192b3 100644 (file)
@@ -143,7 +143,7 @@ static int zserv_encode_nexthop(struct stream *s, struct nexthop *nexthop)
        case NEXTHOP_TYPE_IFINDEX:
                stream_putl(s, nexthop->ifindex);
                break;
-       default:
+       case NEXTHOP_TYPE_BLACKHOLE:
                /* do nothing */
                break;
        }
@@ -576,7 +576,9 @@ int zsend_redistribute_route(int cmd, struct zserv *client,
                else
                        client->redist_v6_del_cnt++;
                break;
-       default:
+       case AFI_L2VPN:
+       case AFI_MAX:
+       case AFI_UNSPEC:
                break;
        }
 
@@ -3424,7 +3426,10 @@ static inline void zread_tc_filter(ZAPI_HANDLER_ARGS)
                        STREAM_GETL(s, filter.filter.u.flower.classid);
                        break;
                }
-               default:
+               case TC_FILTER_BPF:
+               case TC_FILTER_FLOW:
+               case TC_FILTER_U32:
+               case TC_FILTER_UNSPEC:
                        break;
                }
 
index f9f4ee476df553d6502acb7c59679b813ca2b403..863bf61aaeb52ed8acd4add07a1b08cf79bd7e5e 100644 (file)
@@ -902,7 +902,7 @@ static inline int zfpm_encode_route(rib_dest_t *dest, struct route_entry *re,
 #endif /* HAVE_NETLINK */
                break;
 
-       default:
+       case ZFPM_MSG_FORMAT_NONE:
                break;
        }
 
index 06c45578a6bf31d88cf2fe1e09fbd26b456df5d1..fd1bab21d0107865952d4d85fe869a7290c98b24 100644 (file)
@@ -315,7 +315,7 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd,
                                ri->rtm_type = RTN_UNREACHABLE;
                                break;
                        case BLACKHOLE_NULL:
-                       default:
+                       case BLACKHOLE_UNSPEC:
                                ri->rtm_type = RTN_BLACKHOLE;
                                break;
                        }
index 4b31cc0281fe5ebc5d76a53d4d68f622bfc4199c..d18a62e6f805d5c4d8805399bef66e940b7276a1 100644 (file)
@@ -186,7 +186,8 @@ static Fpm__AddRoute *create_add_route_message(qpb_allocator_t *allocator,
                                msg->route_type = FPM__ROUTE_TYPE__UNREACHABLE;
                                break;
                        case BLACKHOLE_NULL:
-                       default:
+                       case BLACKHOLE_UNSPEC:
+                       case BLACKHOLE_ADMINPROHIB:
                                msg->route_type = FPM__ROUTE_TYPE__BLACKHOLE;
                                break;
                        }
index 2042f94038d10719343541aba32cca005bc7ae6e..5603c1e2f868e3fdb45e343c94deb5b9055f3d5a 100644 (file)
@@ -888,7 +888,14 @@ int zebra_mlag_protobuf_encode_client_data(struct stream *s, uint32_t *msg_type)
                if (cleanup)
                        return -1;
        } break;
-       default:
+       case MLAG_REGISTER:
+       case MLAG_DEREGISTER:
+       case MLAG_STATUS_UPDATE:
+       case MLAG_DUMP:
+       case MLAG_PIM_CFG_DUMP:
+       case MLAG_VXLAN_UPDATE:
+       case MLAG_PEER_FRR_STATUS:
+       case MLAG_MSG_NONE:
                break;
        }
 
index fe3f77f3c74f30e1db98b8cc81decc371b87cf41..13963d9cc3f761689b10ae718efcbf8a8ac2902a 100644 (file)
@@ -1848,7 +1848,57 @@ void zebra_mpls_lsp_dplane_result(struct zebra_dplane_ctx *ctx)
                                             ZEBRA_SR_POLICY_LABEL_REMOVED);
                break;
 
-       default:
+       case DPLANE_OP_LSP_NOTIFY:
+       case DPLANE_OP_NONE:
+       case DPLANE_OP_ROUTE_INSTALL:
+       case DPLANE_OP_ROUTE_UPDATE:
+       case DPLANE_OP_ROUTE_DELETE:
+       case DPLANE_OP_ROUTE_NOTIFY:
+       case DPLANE_OP_NH_INSTALL:
+       case DPLANE_OP_NH_UPDATE:
+       case DPLANE_OP_NH_DELETE:
+       case DPLANE_OP_PW_INSTALL:
+       case DPLANE_OP_PW_UNINSTALL:
+       case DPLANE_OP_SYS_ROUTE_ADD:
+       case DPLANE_OP_SYS_ROUTE_DELETE:
+       case DPLANE_OP_ADDR_INSTALL:
+       case DPLANE_OP_ADDR_UNINSTALL:
+       case DPLANE_OP_MAC_INSTALL:
+       case DPLANE_OP_MAC_DELETE:
+       case DPLANE_OP_NEIGH_INSTALL:
+       case DPLANE_OP_NEIGH_UPDATE:
+       case DPLANE_OP_NEIGH_DELETE:
+       case DPLANE_OP_VTEP_ADD:
+       case DPLANE_OP_VTEP_DELETE:
+       case DPLANE_OP_RULE_ADD:
+       case DPLANE_OP_RULE_DELETE:
+       case DPLANE_OP_RULE_UPDATE:
+       case DPLANE_OP_NEIGH_DISCOVER:
+       case DPLANE_OP_BR_PORT_UPDATE:
+       case DPLANE_OP_IPTABLE_ADD:
+       case DPLANE_OP_IPTABLE_DELETE:
+       case DPLANE_OP_IPSET_ADD:
+       case DPLANE_OP_IPSET_DELETE:
+       case DPLANE_OP_IPSET_ENTRY_ADD:
+       case DPLANE_OP_IPSET_ENTRY_DELETE:
+       case DPLANE_OP_NEIGH_IP_INSTALL:
+       case DPLANE_OP_NEIGH_IP_DELETE:
+       case DPLANE_OP_NEIGH_TABLE_UPDATE:
+       case DPLANE_OP_GRE_SET:
+       case DPLANE_OP_INTF_ADDR_ADD:
+       case DPLANE_OP_INTF_ADDR_DEL:
+       case DPLANE_OP_INTF_NETCONFIG:
+       case DPLANE_OP_INTF_INSTALL:
+       case DPLANE_OP_INTF_UPDATE:
+       case DPLANE_OP_INTF_DELETE:
+       case DPLANE_OP_TC_QDISC_INSTALL:
+       case DPLANE_OP_TC_QDISC_UNINSTALL:
+       case DPLANE_OP_TC_CLASS_ADD:
+       case DPLANE_OP_TC_CLASS_DELETE:
+       case DPLANE_OP_TC_CLASS_UPDATE:
+       case DPLANE_OP_TC_FILTER_ADD:
+       case DPLANE_OP_TC_FILTER_DELETE:
+       case DPLANE_OP_TC_FILTER_UPDATE:
                break;
 
        } /* Switch */
index cdf34936c0b4eeec2c0df1c34cd97c44d3d7b0ef..a13f443eb276b0720d6f52ca56f98fd7060340e3 100644 (file)
@@ -255,7 +255,57 @@ static int kernel_lsp_cmd(struct zebra_dplane_ctx *ctx)
        case DPLANE_OP_LSP_UPDATE:
                action = RTM_CHANGE;
                break;
-       default:
+       case DPLANE_OP_NONE:
+       case DPLANE_OP_ROUTE_INSTALL:
+       case DPLANE_OP_ROUTE_UPDATE:
+       case DPLANE_OP_ROUTE_DELETE:
+       case DPLANE_OP_ROUTE_NOTIFY:
+       case DPLANE_OP_NH_INSTALL:
+       case DPLANE_OP_NH_UPDATE:
+       case DPLANE_OP_NH_DELETE:
+       case DPLANE_OP_LSP_NOTIFY:
+       case DPLANE_OP_PW_INSTALL:
+       case DPLANE_OP_PW_UNINSTALL:
+       case DPLANE_OP_SYS_ROUTE_ADD:
+       case DPLANE_OP_SYS_ROUTE_DELETE:
+       case DPLANE_OP_ADDR_INSTALL:
+       case DPLANE_OP_ADDR_UNINSTALL:
+       case DPLANE_OP_MAC_INSTALL:
+       case DPLANE_OP_MAC_DELETE:
+       case DPLANE_OP_NEIGH_INSTALL:
+       case DPLANE_OP_NEIGH_UPDATE:
+       case DPLANE_OP_NEIGH_DELETE:
+       case DPLANE_OP_VTEP_ADD:
+       case DPLANE_OP_VTEP_DELETE:
+       case DPLANE_OP_RULE_ADD:
+       case DPLANE_OP_RULE_DELETE:
+       case DPLANE_OP_RULE_UPDATE:
+       case DPLANE_OP_NEIGH_DISCOVER:
+       case DPLANE_OP_BR_PORT_UPDATE:
+       case DPLANE_OP_IPTABLE_ADD:
+       case DPLANE_OP_IPTABLE_DELETE:
+       case DPLANE_OP_IPSET_ADD:
+       case DPLANE_OP_IPSET_DELETE:
+       case DPLANE_OP_IPSET_ENTRY_ADD:
+       case DPLANE_OP_IPSET_ENTRY_DELETE:
+       case DPLANE_OP_NEIGH_IP_INSTALL:
+       case DPLANE_OP_NEIGH_IP_DELETE:
+       case DPLANE_OP_NEIGH_TABLE_UPDATE:
+       case DPLANE_OP_GRE_SET:
+       case DPLANE_OP_INTF_ADDR_ADD:
+       case DPLANE_OP_INTF_ADDR_DEL:
+       case DPLANE_OP_INTF_NETCONFIG:
+       case DPLANE_OP_INTF_INSTALL:
+       case DPLANE_OP_INTF_UPDATE:
+       case DPLANE_OP_INTF_DELETE:
+       case DPLANE_OP_TC_QDISC_INSTALL:
+       case DPLANE_OP_TC_QDISC_UNINSTALL:
+       case DPLANE_OP_TC_CLASS_ADD:
+       case DPLANE_OP_TC_CLASS_DELETE:
+       case DPLANE_OP_TC_CLASS_UPDATE:
+       case DPLANE_OP_TC_FILTER_ADD:
+       case DPLANE_OP_TC_FILTER_DELETE:
+       case DPLANE_OP_TC_FILTER_UPDATE:
                return -1;
        }
 
@@ -415,7 +465,58 @@ enum zebra_dplane_result kernel_pw_update(struct zebra_dplane_ctx *ctx)
        case DPLANE_OP_PW_UNINSTALL:
                result = kmpw_uninstall(ctx);
                break;
-       default:
+       case DPLANE_OP_NONE:
+       case DPLANE_OP_ROUTE_INSTALL:
+       case DPLANE_OP_ROUTE_UPDATE:
+       case DPLANE_OP_ROUTE_DELETE:
+       case DPLANE_OP_ROUTE_NOTIFY:
+       case DPLANE_OP_NH_INSTALL:
+       case DPLANE_OP_NH_UPDATE:
+       case DPLANE_OP_NH_DELETE:
+       case DPLANE_OP_LSP_INSTALL:
+       case DPLANE_OP_LSP_UPDATE:
+       case DPLANE_OP_LSP_DELETE:
+       case DPLANE_OP_LSP_NOTIFY:
+       case DPLANE_OP_SYS_ROUTE_ADD:
+       case DPLANE_OP_SYS_ROUTE_DELETE:
+       case DPLANE_OP_ADDR_INSTALL:
+       case DPLANE_OP_ADDR_UNINSTALL:
+       case DPLANE_OP_MAC_INSTALL:
+       case DPLANE_OP_MAC_DELETE:
+       case DPLANE_OP_NEIGH_INSTALL:
+       case DPLANE_OP_NEIGH_UPDATE:
+       case DPLANE_OP_NEIGH_DELETE:
+       case DPLANE_OP_VTEP_ADD:
+       case DPLANE_OP_VTEP_DELETE:
+       case DPLANE_OP_RULE_ADD:
+       case DPLANE_OP_RULE_DELETE:
+       case DPLANE_OP_RULE_UPDATE:
+       case DPLANE_OP_NEIGH_DISCOVER:
+       case DPLANE_OP_BR_PORT_UPDATE:
+       case DPLANE_OP_IPTABLE_ADD:
+       case DPLANE_OP_IPTABLE_DELETE:
+       case DPLANE_OP_IPSET_ADD:
+       case DPLANE_OP_IPSET_DELETE:
+       case DPLANE_OP_IPSET_ENTRY_ADD:
+       case DPLANE_OP_IPSET_ENTRY_DELETE:
+       case DPLANE_OP_NEIGH_IP_INSTALL:
+       case DPLANE_OP_NEIGH_IP_DELETE:
+       case DPLANE_OP_NEIGH_TABLE_UPDATE:
+       case DPLANE_OP_GRE_SET:
+       case DPLANE_OP_INTF_ADDR_ADD:
+       case DPLANE_OP_INTF_ADDR_DEL:
+       case DPLANE_OP_INTF_NETCONFIG:
+       case DPLANE_OP_INTF_INSTALL:
+       case DPLANE_OP_INTF_UPDATE:
+       case DPLANE_OP_INTF_DELETE:
+       case DPLANE_OP_TC_QDISC_INSTALL:
+       case DPLANE_OP_TC_QDISC_UNINSTALL:
+       case DPLANE_OP_TC_CLASS_ADD:
+       case DPLANE_OP_TC_CLASS_DELETE:
+       case DPLANE_OP_TC_CLASS_UPDATE:
+       case DPLANE_OP_TC_FILTER_ADD:
+       case DPLANE_OP_TC_FILTER_DELETE:
+       case DPLANE_OP_TC_FILTER_UPDATE:
                break;
        }
 
index 219e4d028a4443420a31fe56aa447524a2fbd508..0f3d56f21432003ca8bc91a2b81c1abee2271bc3 100644 (file)
@@ -706,7 +706,7 @@ lib_vrf_zebra_ribs_rib_route_route_entry_nexthop_group_nexthop_nh_type_get_elem(
        case NEXTHOP_TYPE_IPV6_IFINDEX:
                return yang_data_new_string(args->xpath, "ip6-ifindex");
                break;
-       default:
+       case NEXTHOP_TYPE_BLACKHOLE:
                break;
        }
 
index 758fed7280db4d818da1be810a6dff59e08750d3..0bca00ced369162c2108ce47ae58b159cfc3f3ad 100644 (file)
@@ -2250,7 +2250,9 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe,
                        endpoint.ipa_type = IPADDR_V6;
                        endpoint.ipaddr_v6 = nexthop->gate.ipv6;
                        break;
-               default:
+               case AFI_UNSPEC:
+               case AFI_L2VPN:
+               case AFI_MAX:
                        flog_err(EC_LIB_DEVELOPMENT,
                                 "%s: unknown address-family: %u", __func__,
                                 afi);
@@ -2291,7 +2293,9 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe,
                p.prefixlen = IPV6_MAX_BITLEN;
                p.u.prefix6 = nexthop->gate.ipv6;
                break;
-       default:
+       case AFI_UNSPEC:
+       case AFI_L2VPN:
+       case AFI_MAX:
                assert(afi != AFI_IP && afi != AFI_IP6);
                break;
        }
index 405241fc22808b4ea40022a9aea1426e606aba39..b94fabacfb4b3d23c8c934543eff9b02582b55ad 100644 (file)
@@ -648,7 +648,8 @@ static void zebra_pbr_expand_rule(struct zebra_pbr_rule *rule)
                        zebra_neigh_ref(action->ifindex, &ip, rule);
                        break;
 
-               default:
+               case NEXTHOP_TYPE_BLACKHOLE:
+               case NEXTHOP_TYPE_IFINDEX:
                        action->afi = AFI_UNSPEC;
                }
        }
index 2f71a10d3d249198e244ae2c126ec1737e391678..ba8073defe16cfead19e6ffad43c4ec28a994fb2 100644 (file)
@@ -2158,7 +2158,58 @@ static void rib_process_result(struct zebra_dplane_ctx *ctx)
                    (old_re && RIB_SYSTEM_ROUTE(old_re)))
                        zebra_rib_fixup_system(rn);
                break;
-       default:
+
+       case DPLANE_OP_NONE:
+       case DPLANE_OP_ROUTE_NOTIFY:
+       case DPLANE_OP_NH_INSTALL:
+       case DPLANE_OP_NH_UPDATE:
+       case DPLANE_OP_NH_DELETE:
+       case DPLANE_OP_LSP_INSTALL:
+       case DPLANE_OP_LSP_UPDATE:
+       case DPLANE_OP_LSP_DELETE:
+       case DPLANE_OP_LSP_NOTIFY:
+       case DPLANE_OP_PW_INSTALL:
+       case DPLANE_OP_PW_UNINSTALL:
+       case DPLANE_OP_SYS_ROUTE_ADD:
+       case DPLANE_OP_SYS_ROUTE_DELETE:
+       case DPLANE_OP_ADDR_INSTALL:
+       case DPLANE_OP_ADDR_UNINSTALL:
+       case DPLANE_OP_MAC_INSTALL:
+       case DPLANE_OP_MAC_DELETE:
+       case DPLANE_OP_NEIGH_INSTALL:
+       case DPLANE_OP_NEIGH_UPDATE:
+       case DPLANE_OP_NEIGH_DELETE:
+       case DPLANE_OP_VTEP_ADD:
+       case DPLANE_OP_VTEP_DELETE:
+       case DPLANE_OP_RULE_ADD:
+       case DPLANE_OP_RULE_DELETE:
+       case DPLANE_OP_RULE_UPDATE:
+       case DPLANE_OP_NEIGH_DISCOVER:
+       case DPLANE_OP_BR_PORT_UPDATE:
+       case DPLANE_OP_IPTABLE_ADD:
+       case DPLANE_OP_IPTABLE_DELETE:
+       case DPLANE_OP_IPSET_ADD:
+       case DPLANE_OP_IPSET_DELETE:
+       case DPLANE_OP_IPSET_ENTRY_ADD:
+       case DPLANE_OP_IPSET_ENTRY_DELETE:
+       case DPLANE_OP_NEIGH_IP_INSTALL:
+       case DPLANE_OP_NEIGH_IP_DELETE:
+       case DPLANE_OP_NEIGH_TABLE_UPDATE:
+       case DPLANE_OP_GRE_SET:
+       case DPLANE_OP_INTF_ADDR_ADD:
+       case DPLANE_OP_INTF_ADDR_DEL:
+       case DPLANE_OP_INTF_NETCONFIG:
+       case DPLANE_OP_INTF_INSTALL:
+       case DPLANE_OP_INTF_UPDATE:
+       case DPLANE_OP_INTF_DELETE:
+       case DPLANE_OP_TC_QDISC_INSTALL:
+       case DPLANE_OP_TC_QDISC_UNINSTALL:
+       case DPLANE_OP_TC_CLASS_ADD:
+       case DPLANE_OP_TC_CLASS_DELETE:
+       case DPLANE_OP_TC_CLASS_UPDATE:
+       case DPLANE_OP_TC_FILTER_ADD:
+       case DPLANE_OP_TC_FILTER_DELETE:
+       case DPLANE_OP_TC_FILTER_UPDATE:
                break;
        }
 
@@ -4334,7 +4385,7 @@ void rib_update_table(struct route_table *table, enum rib_update_event event,
                case RIB_UPDATE_OTHER:
                        rib_update_route_node(rn, rtype);
                        break;
-               default:
+               case RIB_UPDATE_MAX:
                        break;
                }
        }
index e24556122b8862a75e1031309d60d95d2a83924c..342a8d0f969c3e93c499cc9ff2314595ee190c05 100644 (file)
@@ -1401,7 +1401,8 @@ void show_nexthop_json_helper(json_object *json_nexthop,
                        json_object_string_addf(json_nexthop, "source", "%pI6",
                                                &nexthop->src.ipv6);
                break;
-       default:
+       case NEXTHOP_TYPE_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                break;
        }
 
@@ -1523,7 +1524,8 @@ void show_route_nexthop_helper(struct vty *vty, const struct route_entry *re,
                if (!IPV6_ADDR_SAME(&nexthop->src.ipv6, &in6addr_any))
                        vty_out(vty, ", src %pI6", &nexthop->src.ipv6);
                break;
-       default:
+       case NEXTHOP_TYPE_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                break;
        }
 
index 4f43cea4930df0794d96f96c342d90b673e50c24..5f307f95e357617695db08513952f827b6a70731 100644 (file)
@@ -1049,7 +1049,9 @@ route_match_ip_next_hop(void *rule, const struct prefix *prefix, void *object)
                p.prefix = nh_data->nexthop->gate.ipv4;
                p.prefixlen = IPV4_MAX_BITLEN;
                break;
-       default:
+       case NEXTHOP_TYPE_IPV6:
+       case NEXTHOP_TYPE_IPV6_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                return RMAP_NOMATCH;
        }
        alist = access_list_lookup(AFI_IP, (char *)rule);
@@ -1105,7 +1107,9 @@ route_match_ip_next_hop_prefix_list(void *rule, const struct prefix *prefix,
                p.prefix = nh_data->nexthop->gate.ipv4;
                p.prefixlen = IPV4_MAX_BITLEN;
                break;
-       default:
+       case NEXTHOP_TYPE_IPV6:
+       case NEXTHOP_TYPE_IPV6_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                return RMAP_NOMATCH;
        }
        plist = prefix_list_lookup(AFI_IP, (char *)rule);
@@ -1364,7 +1368,9 @@ route_match_ip_nexthop_prefix_len(void *rule, const struct prefix *prefix,
                p.prefix = nh_data->nexthop->gate.ipv4;
                p.prefixlen = IPV4_MAX_BITLEN;
                break;
-       default:
+       case NEXTHOP_TYPE_IPV6:
+       case NEXTHOP_TYPE_IPV6_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                return RMAP_NOMATCH;
        }
        return ((p.prefixlen == *prefixlen) ? RMAP_MATCH : RMAP_NOMATCH);
index 746158c4b31d937c971e7e4d4ce9c2cca03a725b..d50d3dfe89130b233fb5c832d53a316ef26c155b 100644 (file)
@@ -140,7 +140,7 @@ static int zebra_sr_policy_notify_update_client(struct zebra_sr_policy *policy,
                stream_putc(s, IPV6_MAX_BITLEN);
                stream_put(s, &policy->endpoint.ipaddr_v6, IPV6_MAX_BYTELEN);
                break;
-       default:
+       case IPADDR_NONE:
                flog_warn(EC_LIB_DEVELOPMENT,
                          "%s: unknown policy endpoint address family: %u",
                          __func__, policy->endpoint.ipa_type);
@@ -202,7 +202,7 @@ static void zebra_sr_policy_notify_update(struct zebra_sr_policy *policy)
                p.prefixlen = IPV6_MAX_BITLEN;
                p.u.prefix6 = policy->endpoint.ipaddr_v6;
                break;
-       default:
+       case IPADDR_NONE:
                flog_warn(EC_LIB_DEVELOPMENT,
                          "%s: unknown policy endpoint address family: %u",
                          __func__, policy->endpoint.ipa_type);
index 8a73ae3d281e8c53c320853042c7ec94012651b3..d96ee4890fe610cf1aaf869608f26928ae89a81f 100644 (file)
@@ -405,7 +405,8 @@ static void show_nexthop_detail_helper(struct vty *vty,
                }
                break;
 
-       default:
+       case NEXTHOP_TYPE_IFINDEX:
+       case NEXTHOP_TYPE_BLACKHOLE:
                break;
        }