summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-02-07 21:22:27 +0100
committerGitHub <noreply@github.com>2023-02-07 21:22:27 +0100
commit96475dfde95f0776844dee3b72780851107f879d (patch)
treed1ba1935d87841d04ca51999878693bf65419852 /zebra
parentMerge pull request #12759 from opensourcerouting/fix/revalidate_commit_on_pr_... (diff)
parent*: Add -Wswitch-enum to build (diff)
downloadfrr-96475dfde95f0776844dee3b72780851107f879d.tar.xz
frr-96475dfde95f0776844dee3b72780851107f879d.zip
Merge pull request #12707 from donaldsharp/missed_enums
Missed enums
Diffstat (limited to 'zebra')
-rw-r--r--zebra/connected.c8
-rw-r--r--zebra/if_netlink.c52
-rw-r--r--zebra/kernel_socket.c3
-rw-r--r--zebra/router-id.c10
-rw-r--r--zebra/rt_netlink.c62
-rw-r--r--zebra/tc_netlink.c3
-rw-r--r--zebra/zapi_msg.c11
-rw-r--r--zebra/zebra_fpm.c2
-rw-r--r--zebra/zebra_fpm_netlink.c2
-rw-r--r--zebra/zebra_fpm_protobuf.c3
-rw-r--r--zebra/zebra_mlag.c9
-rw-r--r--zebra/zebra_mpls.c52
-rw-r--r--zebra/zebra_mpls_openbsd.c105
-rw-r--r--zebra/zebra_nb_state.c2
-rw-r--r--zebra/zebra_nhg.c8
-rw-r--r--zebra/zebra_pbr.c3
-rw-r--r--zebra/zebra_rib.c55
-rw-r--r--zebra/zebra_rnh.c6
-rw-r--r--zebra/zebra_routemap.c12
-rw-r--r--zebra/zebra_srte.c4
-rw-r--r--zebra/zebra_vty.c3
21 files changed, 380 insertions, 35 deletions
diff --git a/zebra/connected.c b/zebra/connected.c
index c01be58e8..9c207acf3 100644
--- a/zebra/connected.c
+++ b/zebra/connected.c
@@ -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;
}
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c
index d628e4749..835659332 100644
--- a/zebra/if_netlink.c
+++ b/zebra/if_netlink.c
@@ -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)",
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index 684ccc3ed..332b8fc67 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -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;
}
diff --git a/zebra/router-id.c b/zebra/router-id.c
index 9f56cf0e6..ea429f683 100644
--- a/zebra/router-id.c
+++ b/zebra/router-id.c
@@ -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;
}
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 79d79d74b..216b719ff 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -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;
}
diff --git a/zebra/tc_netlink.c b/zebra/tc_netlink.c
index 1fa80e846..757dc1d34 100644
--- a/zebra/tc_netlink.c
+++ b/zebra/tc_netlink.c
@@ -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;
}
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index a2233a666..fdea766a1 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -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;
}
diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c
index f9f4ee476..863bf61aa 100644
--- a/zebra/zebra_fpm.c
+++ b/zebra/zebra_fpm.c
@@ -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;
}
diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c
index 06c45578a..fd1bab21d 100644
--- a/zebra/zebra_fpm_netlink.c
+++ b/zebra/zebra_fpm_netlink.c
@@ -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;
}
diff --git a/zebra/zebra_fpm_protobuf.c b/zebra/zebra_fpm_protobuf.c
index 4b31cc028..d18a62e6f 100644
--- a/zebra/zebra_fpm_protobuf.c
+++ b/zebra/zebra_fpm_protobuf.c
@@ -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;
}
diff --git a/zebra/zebra_mlag.c b/zebra/zebra_mlag.c
index 2042f9403..5603c1e2f 100644
--- a/zebra/zebra_mlag.c
+++ b/zebra/zebra_mlag.c
@@ -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;
}
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index fe3f77f3c..13963d9cc 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -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 */
diff --git a/zebra/zebra_mpls_openbsd.c b/zebra/zebra_mpls_openbsd.c
index cdf34936c..a13f443eb 100644
--- a/zebra/zebra_mpls_openbsd.c
+++ b/zebra/zebra_mpls_openbsd.c
@@ -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;
}
diff --git a/zebra/zebra_nb_state.c b/zebra/zebra_nb_state.c
index 219e4d028..0f3d56f21 100644
--- a/zebra/zebra_nb_state.c
+++ b/zebra/zebra_nb_state.c
@@ -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;
}
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c
index 758fed728..0bca00ced 100644
--- a/zebra/zebra_nhg.c
+++ b/zebra/zebra_nhg.c
@@ -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;
}
diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c
index 405241fc2..b94fabacf 100644
--- a/zebra/zebra_pbr.c
+++ b/zebra/zebra_pbr.c
@@ -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;
}
}
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 2f71a10d3..ba8073def 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -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;
}
}
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index e24556122..342a8d0f9 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -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;
}
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c
index 4f43cea49..5f307f95e 100644
--- a/zebra/zebra_routemap.c
+++ b/zebra/zebra_routemap.c
@@ -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);
diff --git a/zebra/zebra_srte.c b/zebra/zebra_srte.c
index 746158c4b..d50d3dfe8 100644
--- a/zebra/zebra_srte.c
+++ b/zebra/zebra_srte.c
@@ -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);
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 8a73ae3d2..d96ee4890 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -405,7 +405,8 @@ static void show_nexthop_detail_helper(struct vty *vty,
}
break;
- default:
+ case NEXTHOP_TYPE_IFINDEX:
+ case NEXTHOP_TYPE_BLACKHOLE:
break;
}