diff options
Diffstat (limited to 'zebra')
| -rw-r--r-- | zebra/debug.c | 26 | ||||
| -rw-r--r-- | zebra/debug.h | 5 | ||||
| -rw-r--r-- | zebra/dplane_fpm_nl.c | 12 | ||||
| -rw-r--r-- | zebra/kernel_netlink.c | 8 | ||||
| -rw-r--r-- | zebra/rt_netlink.c | 3 | ||||
| -rw-r--r-- | zebra/rt_socket.c | 8 | ||||
| -rw-r--r-- | zebra/zebra_rib.c | 60 | ||||
| -rw-r--r-- | zebra/zebra_rnh.c | 4 | ||||
| -rw-r--r-- | zebra/zebra_srv6.c | 66 | ||||
| -rw-r--r-- | zebra/zebra_vty.c | 6 |
10 files changed, 112 insertions, 86 deletions
diff --git a/zebra/debug.c b/zebra/debug.c index cf1701be19..7b6a19fa1d 100644 --- a/zebra/debug.c +++ b/zebra/debug.c @@ -29,6 +29,7 @@ unsigned long zebra_debug_evpn_mh; unsigned long zebra_debug_pbr; unsigned long zebra_debug_neigh; unsigned long zebra_debug_tc; +unsigned long zebra_debug_srv6; DEFINE_HOOK(zebra_debug_show_debugging, (struct vty *vty), (vty)); @@ -121,6 +122,9 @@ DEFUN_NOSH (show_debugging_zebra, if (IS_ZEBRA_DEBUG_PBR) vty_out(vty, " Zebra PBR debugging is on\n"); + if (IS_ZEBRA_DEBUG_SRV6) + vty_out(vty, " Zebra SRv6 is on\n"); + hook_call(zebra_debug_show_debugging, vty); cmd_show_lib_debugs(vty); @@ -372,6 +376,21 @@ DEFUN (debug_zebra_tc, return CMD_SUCCESS; } +DEFPY(debug_zebra_srv6, + debug_zebra_srv6_cmd, + "[no$no] debug zebra srv6", + NO_STR + DEBUG_STR + "Zebra configuration\n" + "Debug zebra SRv6 events\n") +{ + if (no) + UNSET_FLAG(zebra_debug_srv6, ZEBRA_DEBUG_SRV6); + else + SET_FLAG(zebra_debug_srv6, ZEBRA_DEBUG_SRV6); + return CMD_SUCCESS; +} + DEFPY (debug_zebra_mlag, debug_zebra_mlag_cmd, "[no$no] debug zebra mlag", @@ -754,6 +773,11 @@ static int config_write_debug(struct vty *vty) write++; } + if (IS_ZEBRA_DEBUG_SRV6) { + vty_out(vty, "debug zebra srv6\n"); + write++; + } + return write; } @@ -793,6 +817,7 @@ void zebra_debug_init(void) install_element(ENABLE_NODE, &debug_zebra_rib_cmd); install_element(ENABLE_NODE, &debug_zebra_fpm_cmd); install_element(ENABLE_NODE, &debug_zebra_dplane_cmd); + install_element(ENABLE_NODE, &debug_zebra_srv6_cmd); install_element(ENABLE_NODE, &debug_zebra_mlag_cmd); install_element(ENABLE_NODE, &debug_zebra_nexthop_cmd); install_element(ENABLE_NODE, &debug_zebra_pbr_cmd); @@ -845,6 +870,7 @@ void zebra_debug_init(void) install_element(CONFIG_NODE, &no_debug_zebra_fpm_cmd); install_element(CONFIG_NODE, &no_debug_zebra_dplane_cmd); install_element(CONFIG_NODE, &no_debug_zebra_pbr_cmd); + install_element(CONFIG_NODE, &debug_zebra_srv6_cmd); install_element(CONFIG_NODE, &debug_zebra_mlag_cmd); install_element(CONFIG_NODE, &debug_zebra_evpn_mh_cmd); diff --git a/zebra/debug.h b/zebra/debug.h index 075d903c6b..b4e5ee4b5b 100644 --- a/zebra/debug.h +++ b/zebra/debug.h @@ -62,6 +62,8 @@ extern "C" { #define ZEBRA_DEBUG_TC 0x01 +#define ZEBRA_DEBUG_SRV6 0x01 + /* Debug related macro. */ #define IS_ZEBRA_DEBUG_EVENT (zebra_debug_event & ZEBRA_DEBUG_EVENT) @@ -122,6 +124,8 @@ extern "C" { #define IS_ZEBRA_DEBUG_TC (zebra_debug_tc & ZEBRA_DEBUG_TC) +#define IS_ZEBRA_DEBUG_SRV6 (zebra_debug_srv6 & ZEBRA_DEBUG_SRV6) + extern unsigned long zebra_debug_event; extern unsigned long zebra_debug_packet; extern unsigned long zebra_debug_kernel; @@ -139,6 +143,7 @@ extern unsigned long zebra_debug_evpn_mh; extern unsigned long zebra_debug_pbr; extern unsigned long zebra_debug_neigh; extern unsigned long zebra_debug_tc; +extern unsigned long zebra_debug_srv6; extern void zebra_debug_init(void); diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c index 8a967978cb..e6b4af3674 100644 --- a/zebra/dplane_fpm_nl.c +++ b/zebra/dplane_fpm_nl.c @@ -1712,6 +1712,16 @@ static int fpm_nl_process(struct zebra_dplane_provider *prov) * anyway. */ if (fnc->socket != -1 && fnc->connecting == false) { + enum dplane_op_e op = dplane_ctx_get_op(ctx); + + /* + * Just skip multicast routes and let them flow through + */ + if ((op == DPLANE_OP_ROUTE_DELETE || op == DPLANE_OP_ROUTE_INSTALL || + op == DPLANE_OP_ROUTE_UPDATE) && + dplane_ctx_get_safi(ctx) == SAFI_MULTICAST) + goto skip; + frr_with_mutex (&fnc->ctxqueue_mutex) { dplane_ctx_enqueue_tail(&fnc->ctxqueue, ctx); cur_queue = @@ -1722,7 +1732,7 @@ static int fpm_nl_process(struct zebra_dplane_provider *prov) peak_queue = cur_queue; continue; } - +skip: dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_SUCCESS); dplane_provider_enqueue_out_ctx(prov, ctx); } diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index 3547314f84..0c607dfa67 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -405,10 +405,6 @@ static int netlink_information_fetch(struct nlmsghdr *h, ns_id_t ns_id, return netlink_route_change(h, ns_id, startup); case RTM_DELROUTE: return netlink_route_change(h, ns_id, startup); - case RTM_NEWLINK: - return netlink_link_change(h, ns_id, startup); - case RTM_DELLINK: - return 0; case RTM_NEWNEIGH: case RTM_DELNEIGH: case RTM_GETNEIGH: @@ -438,6 +434,8 @@ static int netlink_information_fetch(struct nlmsghdr *h, ns_id_t ns_id, return 0; /* Messages handled in the dplane thread */ + case RTM_NEWLINK: + case RTM_DELLINK: case RTM_NEWADDR: case RTM_DELADDR: case RTM_NEWNETCONF: @@ -934,7 +932,7 @@ static int netlink_recv_msg(struct nlsock *nl, struct msghdr *msg) } while (status == -1 && errno == EINTR); if (status == -1) { - if (errno == EWOULDBLOCK || errno == EAGAIN) + if (errno == EWOULDBLOCK || errno == EAGAIN || errno == EMSGSIZE) return 0; flog_err(EC_ZEBRA_RECVMSG_OVERRUN, "%s recvmsg overrun: %s", nl->name, safe_strerror(errno)); diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index dc679ed495..ab07ef8d21 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -3178,6 +3178,9 @@ netlink_put_route_update_msg(struct nl_batch *bth, struct zebra_dplane_ctx *ctx) } else return FRR_NETLINK_ERROR; + if (dplane_ctx_get_safi(ctx) == SAFI_MULTICAST) + return FRR_NETLINK_SUCCESS; + if (RSYSTEM_ROUTE(dplane_ctx_get_type(ctx))) return FRR_NETLINK_SUCCESS; diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c index 0bfcd518ca..4444eda94b 100644 --- a/zebra/rt_socket.c +++ b/zebra/rt_socket.c @@ -317,12 +317,12 @@ enum zebra_dplane_result kernel_route_update(struct zebra_dplane_ctx *ctx) frr_with_privs(&zserv_privs) { if (dplane_ctx_get_op(ctx) == DPLANE_OP_ROUTE_DELETE) { - if (!RSYSTEM_ROUTE(type)) + if (!RSYSTEM_ROUTE(type) && dplane_ctx_get_safi(ctx) != SAFI_MULTICAST) kernel_rtm(RTM_DELETE, dplane_ctx_get_dest(ctx), dplane_ctx_get_ng(ctx), dplane_ctx_get_metric(ctx)); } else if (dplane_ctx_get_op(ctx) == DPLANE_OP_ROUTE_INSTALL) { - if (!RSYSTEM_ROUTE(type)) + if (!RSYSTEM_ROUTE(type) && dplane_ctx_get_safi(ctx) != SAFI_MULTICAST) kernel_rtm(RTM_ADD, dplane_ctx_get_dest(ctx), dplane_ctx_get_ng(ctx), dplane_ctx_get_metric(ctx)); @@ -330,12 +330,12 @@ enum zebra_dplane_result kernel_route_update(struct zebra_dplane_ctx *ctx) /* Must do delete and add separately - * no update available */ - if (!RSYSTEM_ROUTE(old_type)) + if (!RSYSTEM_ROUTE(old_type) && dplane_ctx_get_safi(ctx) != SAFI_MULTICAST) kernel_rtm(RTM_DELETE, dplane_ctx_get_dest(ctx), dplane_ctx_get_old_ng(ctx), dplane_ctx_get_old_metric(ctx)); - if (!RSYSTEM_ROUTE(type)) + if (!RSYSTEM_ROUTE(type) && dplane_ctx_get_safi(ctx) != SAFI_MULTICAST) kernel_rtm(RTM_ADD, dplane_ctx_get_dest(ctx), dplane_ctx_get_ng(ctx), dplane_ctx_get_metric(ctx)); diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 72421dc8ee..aea39b8ecf 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -637,23 +637,12 @@ int zebra_rib_labeled_unicast(struct route_entry *re) void rib_install_kernel(struct route_node *rn, struct route_entry *re, struct route_entry *old) { - struct nexthop *nexthop; struct rib_table_info *info = srcdest_rnode_table_info(rn); struct zebra_vrf *zvrf = zebra_vrf_lookup_by_id(re->vrf_id); - const struct prefix *p, *src_p; enum zebra_dplane_result ret; rib_dest_t *dest = rib_dest_from_rnode(rn); - srcdest_rnode_prefixes(rn, &p, &src_p); - - if (info->safi != SAFI_UNICAST) { - for (ALL_NEXTHOPS(re->nhe->nhg, nexthop)) - SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB); - return; - } - - /* * Install the resolved nexthop object first. */ @@ -720,17 +709,8 @@ void rib_install_kernel(struct route_node *rn, struct route_entry *re, /* Uninstall the route from kernel. */ void rib_uninstall_kernel(struct route_node *rn, struct route_entry *re) { - struct nexthop *nexthop; - struct rib_table_info *info = srcdest_rnode_table_info(rn); struct zebra_vrf *zvrf = zebra_vrf_lookup_by_id(re->vrf_id); - if (info->safi != SAFI_UNICAST) { - UNSET_FLAG(re->status, ROUTE_ENTRY_INSTALLED); - for (ALL_NEXTHOPS(re->nhe->nhg, nexthop)) - UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB); - return; - } - /* * Make sure we update the FPM any time we send new information to * the dataplane. @@ -1268,8 +1248,15 @@ static void rib_process(struct route_node *rn) struct zebra_vrf *zvrf = NULL; struct vrf *vrf; struct route_entry *proto_re_changed = NULL; - vrf_id_t vrf_id = VRF_UNKNOWN; + safi_t safi = SAFI_UNICAST; + + if (IS_ZEBRA_DEBUG_RIB || IS_ZEBRA_DEBUG_RIB_DETAILED) { + struct rib_table_info *info = srcdest_rnode_table_info(rn); + + assert(info); + safi = info->safi; + } assert(rn); @@ -1295,9 +1282,8 @@ static void rib_process(struct route_node *rn) if (IS_ZEBRA_DEBUG_RIB_DETAILED) { struct route_entry *re = re_list_first(&dest->routes); - zlog_debug("%s(%u:%u):%pRN: Processing rn %p", - VRF_LOGNAME(vrf), vrf_id, re->table, rn, - rn); + zlog_debug("%s(%u:%u:%u):%pRN: Processing rn %p", VRF_LOGNAME(vrf), vrf_id, + re->table, safi, rn, rn); } old_fib = dest->selected_fib; @@ -1307,15 +1293,12 @@ static void rib_process(struct route_node *rn) char flags_buf[128]; char status_buf[128]; - zlog_debug( - "%s(%u:%u):%pRN: Examine re %p (%s) status: %sflags: %sdist %d metric %d", - VRF_LOGNAME(vrf), vrf_id, re->table, rn, re, - zebra_route_string(re->type), - _dump_re_status(re, status_buf, - sizeof(status_buf)), - zclient_dump_route_flags(re->flags, flags_buf, - sizeof(flags_buf)), - re->distance, re->metric); + zlog_debug("%s(%u:%u:%u):%pRN: Examine re %p (%s) status: %sflags: %sdist %d metric %d", + VRF_LOGNAME(vrf), vrf_id, re->table, safi, rn, re, + zebra_route_string(re->type), + _dump_re_status(re, status_buf, sizeof(status_buf)), + zclient_dump_route_flags(re->flags, flags_buf, sizeof(flags_buf)), + re->distance, re->metric); } /* Currently selected re. */ @@ -1339,7 +1322,6 @@ static void rib_process(struct route_node *rn) if (CHECK_FLAG(re->status, ROUTE_ENTRY_CHANGED)) { proto_re_changed = re; if (!nexthop_active_update(rn, re, old_fib)) { - const struct prefix *p; struct rib_table_info *info; if (re->type == ZEBRA_ROUTE_TABLE) { @@ -1373,7 +1355,6 @@ static void rib_process(struct route_node *rn) } info = srcdest_rnode_table_info(rn); - srcdest_rnode_prefixes(rn, &p, NULL); zsend_route_notify_owner( rn, re, ZAPI_ROUTE_FAIL_INSTALL, info->afi, info->safi); @@ -1441,11 +1422,10 @@ static void rib_process(struct route_node *rn) : old_fib ? old_fib : new_fib ? new_fib : NULL; - zlog_debug( - "%s(%u:%u):%pRN: After processing: old_selected %p new_selected %p old_fib %p new_fib %p", - VRF_LOGNAME(vrf), vrf_id, entry ? entry->table : 0, rn, - (void *)old_selected, (void *)new_selected, - (void *)old_fib, (void *)new_fib); + zlog_debug("%s(%u:%u:%u):%pRN: After processing: old_selected %p new_selected %p old_fib %p new_fib %p", + VRF_LOGNAME(vrf), vrf_id, entry ? entry->table : 0, safi, rn, + (void *)old_selected, (void *)new_selected, (void *)old_fib, + (void *)new_fib); } /* Buffer ROUTE_ENTRY_CHANGED here, because it will get cleared if diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 35486a4cd0..640e6551a7 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -1271,7 +1271,7 @@ void show_nexthop_json_helper(json_object *json_nexthop, bool display_vrfid = false; uint8_t rn_family; - if (re == NULL || nexthop->vrf_id != re->vrf_id) + if ((re == NULL || nexthop->vrf_id != re->vrf_id) && nexthop->type != NEXTHOP_TYPE_BLACKHOLE) display_vrfid = true; if (rn) @@ -1292,7 +1292,7 @@ void show_route_nexthop_helper(struct vty *vty, const struct route_node *rn, bool display_vrfid = false; uint8_t rn_family; - if (re == NULL || nexthop->vrf_id != re->vrf_id) + if ((re == NULL || nexthop->vrf_id != re->vrf_id) && nexthop->type != NEXTHOP_TYPE_BLACKHOLE) display_vrfid = true; if (rn) diff --git a/zebra/zebra_srv6.c b/zebra/zebra_srv6.c index 082d4609aa..92015684f4 100644 --- a/zebra/zebra_srv6.c +++ b/zebra/zebra_srv6.c @@ -214,7 +214,7 @@ void zebra_srv6_locator_format_set(struct srv6_locator *locator, locator->sid_format = format; - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: Locator %s format has changed, old=%s new=%s", __func__, locator->name, locator->sid_format ? ((struct srv6_sid_format *) @@ -237,7 +237,7 @@ void zebra_srv6_locator_format_set(struct srv6_locator *locator, zebra_srv6_sid_ctx_free(ctx); } - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: Locator %s format has changed, send SRV6_LOCATOR_DEL notification to zclients", __func__, locator->name); @@ -269,7 +269,7 @@ void zebra_srv6_locator_format_set(struct srv6_locator *locator, block_new->refcnt++; locator->sid_block = block_new; - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: Locator %s format has changed, send SRV6_LOCATOR_ADD notification to zclients", __func__, locator->name); @@ -293,13 +293,13 @@ void zebra_srv6_sid_format_changed_cb(struct srv6_sid_format *format) struct listnode *node, *nnode; struct zebra_srv6_sid_ctx *ctx; - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: SID format %s has changed. Notifying zclients.", __func__, format->name); for (ALL_LIST_ELEMENTS_RO(srv6->locators, node, locator)) { if (locator->sid_format == format) { - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: Locator %s has changed because its format (%s) has been modified. Notifying zclients.", __func__, locator->name, format->name); @@ -801,7 +801,7 @@ static int zebra_srv6_manager_get_locator_chunk(struct srv6_locator **loc, if (!*loc) zlog_err("Unable to assign locator chunk to %s instance %u", zebra_route_string(client->proto), client->instance); - else if (IS_ZEBRA_DEBUG_PACKET) + else if (IS_ZEBRA_DEBUG_SRV6) zlog_info("Assigned locator chunk %s to %s instance %u", (*loc)->name, zebra_route_string(client->proto), client->instance); @@ -835,7 +835,7 @@ static int release_srv6_locator_chunk(uint8_t proto, uint16_t instance, if (!loc) return -1; - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: Releasing srv6-locator on %s", __func__, locator_name); @@ -892,7 +892,7 @@ int release_daemon_srv6_locator_chunks(struct zserv *client) struct srv6_locator *loc; struct srv6_locator_chunk *chunk; - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: Releasing chunks for client proto %s, instance %d, session %u", __func__, zebra_route_string(client->proto), client->instance, client->session_id); @@ -912,7 +912,7 @@ int release_daemon_srv6_locator_chunks(struct zserv *client) } } - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: Released %d srv6-locator chunks", __func__, count); @@ -1159,7 +1159,7 @@ static bool alloc_srv6_sid_func_explicit(struct zebra_srv6_sid_block *block, format = block->sid_format; - if (ZEBRA_DEBUG_PACKET) + if (ZEBRA_DEBUG_SRV6) zlog_debug("%s: trying to allocate explicit SID function %u from block %pFX", __func__, sid_func, &block->prefix); @@ -1305,7 +1305,7 @@ static bool alloc_srv6_sid_func_explicit(struct zebra_srv6_sid_block *block, block->u.uncompressed.num_func_allocated++; } - if (ZEBRA_DEBUG_PACKET) + if (ZEBRA_DEBUG_SRV6) zlog_debug("%s: allocated explicit SID function %u from block %pFX", __func__, sid_func, &block->prefix); @@ -1331,7 +1331,7 @@ static bool alloc_srv6_sid_func_dynamic(struct zebra_srv6_sid_block *block, format = block->sid_format; - if (ZEBRA_DEBUG_PACKET) + if (ZEBRA_DEBUG_SRV6) zlog_debug("%s: trying to allocate dynamic SID function from block %pFX", __func__, &block->prefix); @@ -1465,7 +1465,7 @@ static bool alloc_srv6_sid_func_dynamic(struct zebra_srv6_sid_block *block, block->u.uncompressed.num_func_allocated++; } - if (ZEBRA_DEBUG_PACKET) + if (ZEBRA_DEBUG_SRV6) zlog_debug("%s: allocated dynamic SID function %u from block %pFX", __func__, *sid_func, &block->prefix); @@ -1510,7 +1510,7 @@ static int get_srv6_sid_explicit(struct zebra_srv6_sid **sid, * return the existing SID */ if (sid_same(&s->sid->value, sid_value)) { - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: returning existing SRv6 SID %pI6 ctx %s", __func__, &s->sid->value, srv6_sid_ctx2str(buf, @@ -1569,7 +1569,7 @@ static int get_srv6_sid_explicit(struct zebra_srv6_sid **sid, * deallocate the current SID function before allocating the new one */ if (zctx->sid) { - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: ctx %s already associated with a dynamic SID %pI6, releasing dynamic SID", __func__, srv6_sid_ctx2str(buf, sizeof(buf), @@ -1595,7 +1595,7 @@ static int get_srv6_sid_explicit(struct zebra_srv6_sid **sid, zctx->sid = *sid; listnode_add(srv6->sids, zctx); - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: allocated explicit SRv6 SID %pI6 for context %s", __func__, &(*sid)->value, srv6_sid_ctx2str(buf, sizeof(buf), ctx)); @@ -1648,7 +1648,7 @@ static int get_srv6_sid_dynamic(struct zebra_srv6_sid **sid, } } if (memcmp(&s->ctx, ctx, sizeof(struct srv6_sid_ctx)) == 0) { - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: returning existing SID %s %pI6", __func__, srv6_sid_ctx2str(buf, sizeof(buf), @@ -1695,7 +1695,7 @@ static int get_srv6_sid_dynamic(struct zebra_srv6_sid **sid, zctx->sid = *sid; listnode_add(srv6->sids, zctx); - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: allocated new dynamic SRv6 SID %pI6 for context %s", __func__, &(*sid)->value, srv6_sid_ctx2str(buf, sizeof(buf), ctx)); @@ -1733,7 +1733,7 @@ int get_srv6_sid(struct zebra_srv6_sid **sid, struct srv6_sid_ctx *ctx, (sid_value) ? SRV6_SID_ALLOC_MODE_EXPLICIT : SRV6_SID_ALLOC_MODE_DYNAMIC; - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: received SRv6 SID alloc request: SID ctx %s (%pI6), mode=%s", __func__, srv6_sid_ctx2str(buf, sizeof(buf), ctx), sid_value, srv6_sid_alloc_mode2str(alloc_mode)); @@ -1794,7 +1794,7 @@ static bool release_srv6_sid_func_explicit(struct zebra_srv6_sid_block *block, format = block->sid_format; - if (ZEBRA_DEBUG_PACKET) + if (ZEBRA_DEBUG_SRV6) zlog_debug("%s: trying to release explicit SRv6 SID function %u from block %pFX", __func__, sid_func, &block->prefix); @@ -1918,7 +1918,7 @@ static bool release_srv6_sid_func_explicit(struct zebra_srv6_sid_block *block, zebra_srv6_sid_func_free(sid_func_ptr); } - if (ZEBRA_DEBUG_PACKET) + if (ZEBRA_DEBUG_SRV6) zlog_debug("%s: released explicit SRv6 SID function %u from block %pFX", __func__, sid_func, &block->prefix); @@ -1944,7 +1944,7 @@ static int release_srv6_sid_func_dynamic(struct zebra_srv6_sid_block *block, format = block->sid_format; - if (ZEBRA_DEBUG_PACKET) + if (ZEBRA_DEBUG_SRV6) zlog_debug("%s: trying to release dynamic SRv6 SID function %u from block %pFX", __func__, sid_func, &block->prefix); @@ -2107,7 +2107,7 @@ static int release_srv6_sid_func_dynamic(struct zebra_srv6_sid_block *block, } } - if (ZEBRA_DEBUG_PACKET) + if (ZEBRA_DEBUG_SRV6) zlog_debug("%s: released dynamic SRv6 SID function %u from block %pFX", __func__, sid_func, &block->prefix); @@ -2129,7 +2129,7 @@ int release_srv6_sid(struct zserv *client, struct zebra_srv6_sid_ctx *zctx) if (!zctx || !zctx->sid) return -1; - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: releasing SRv6 SID %pI6 associated with ctx %s (proto=%u, instance=%u)", __func__, &zctx->sid->value, srv6_sid_ctx2str(buf, sizeof(buf), &zctx->ctx), @@ -2145,7 +2145,7 @@ int release_srv6_sid(struct zserv *client, struct zebra_srv6_sid_ctx *zctx) /* Remove the client from the list of clients using the SID */ listnode_delete(zctx->sid->client_list, client); - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: released SRv6 SID %pI6 associated with ctx %s (proto=%u, instance=%u)", __func__, &zctx->sid->value, srv6_sid_ctx2str(buf, sizeof(buf), &zctx->ctx), @@ -2156,7 +2156,7 @@ int release_srv6_sid(struct zserv *client, struct zebra_srv6_sid_ctx *zctx) * and remove it from the SRv6 database. */ if (listcount(zctx->sid->client_list) == 0) { - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: SRv6 SID %pI6 associated with ctx %s is no longer in use, removing it from SRv6 database", __func__, &zctx->sid->value, srv6_sid_ctx2str(buf, sizeof(buf), @@ -2251,7 +2251,7 @@ static int srv6_manager_get_sid_internal(struct zebra_srv6_sid **sid, struct zserv *c; char buf[256]; - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: getting SRv6 SID for ctx %s, sid_value=%pI6, locator_name=%s", __func__, srv6_sid_ctx2str(buf, sizeof(buf), ctx), sid_value ? sid_value : &in6addr_any, locator_name); @@ -2266,7 +2266,7 @@ static int srv6_manager_get_sid_internal(struct zebra_srv6_sid **sid, zsend_srv6_sid_notify(client, ctx, sid_value, 0, 0, NULL, ZAPI_SRV6_SID_FAIL_ALLOC); } else if (ret == 0) { - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: got existing SRv6 SID for ctx %s: sid_value=%pI6 (func=%u) (proto=%u, instance=%u, sessionId=%u), notify client", __func__, srv6_sid_ctx2str(buf, sizeof(buf), ctx), @@ -2281,7 +2281,7 @@ static int srv6_manager_get_sid_internal(struct zebra_srv6_sid **sid, : NULL, ZAPI_SRV6_SID_ALLOCATED); } else { - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: got new SRv6 SID for ctx %s: sid_value=%pI6 (func=%u) (proto=%u, instance=%u, sessionId=%u), notifying all clients", __func__, srv6_sid_ctx2str(buf, sizeof(buf), ctx), @@ -2318,7 +2318,7 @@ int release_daemon_srv6_sids(struct zserv *client) int count = 0; int ret; - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: releasing SRv6 SIDs for client proto %s, instance %d, session %u", __func__, zebra_route_string(client->proto), client->instance, client->session_id); @@ -2333,7 +2333,7 @@ int release_daemon_srv6_sids(struct zserv *client) count++; } - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: released %d SRv6 SIDs", __func__, count); return count; @@ -2356,7 +2356,7 @@ static int srv6_manager_release_sid_internal(struct zserv *client, char buf[256]; const char *locator_name = NULL; - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: releasing SRv6 SID associated with ctx %s", __func__, srv6_sid_ctx2str(buf, sizeof(buf), ctx)); @@ -2370,7 +2370,7 @@ static int srv6_manager_release_sid_internal(struct zserv *client, break; } - if (IS_ZEBRA_DEBUG_PACKET) + if (IS_ZEBRA_DEBUG_SRV6) zlog_debug("%s: no SID associated with ctx %s", __func__, srv6_sid_ctx2str(buf, sizeof(buf), ctx)); diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 3bf20ff42e..309cde9a35 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -370,7 +370,7 @@ static void show_nexthop_detail_helper(struct vty *vty, break; } - if (re->vrf_id != nexthop->vrf_id) { + if (re->vrf_id != nexthop->vrf_id && nexthop->type != NEXTHOP_TYPE_BLACKHOLE) { struct vrf *vrf = vrf_lookup_by_id(nexthop->vrf_id); vty_out(vty, "(vrf %s)", VRF_LOGNAME(vrf)); @@ -3802,6 +3802,10 @@ static int config_write_protocol(struct vty *vty) if (!zebra_nhg_recursive_use_backups()) vty_out(vty, "no zebra nexthop resolve-via-backup\n"); +#ifdef HAVE_SCRIPTING + frrscript_names_config_write(vty); +#endif + if (rnh_get_hide_backups()) vty_out(vty, "ip nht hide-backup-events\n"); |
