Page MenuHomeVyOS Platform

frr_debug.patch

Authored By
v.huti
Jul 14 2022, 1:59 PM
Size
23 KB
Referenced Files
None
Subscribers
None

frr_debug.patch

diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 5df45aa31..316be1960 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -3005,10 +3005,12 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
if (new_select->type == ZEBRA_ROUTE_BGP
&& (new_select->sub_type == BGP_ROUTE_NORMAL
|| new_select->sub_type
- == BGP_ROUTE_IMPORTED))
+ == BGP_ROUTE_IMPORTED)) {
+ zlog_debug("QQQ Announce IMPORTED");
bgp_zebra_announce(dest, p, old_select,
bgp, afi, safi);
+ }
}
}
@@ -3119,6 +3121,14 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
is_route_parent_evpn(old_select))
bgp_zebra_withdraw(p, old_select, bgp, safi);
+ if (!old_select)
+ zlog_debug("QQQ Announce fib_update no old [%d]", new_select->attr->dscp);
+ /* else { */
+ /* zlog_debug("QQQ Announce fib_update [%d|%d|%p|%p]", */
+ /* new_select->dscp, old_select->dscp, */
+ /* new_select, old_select); */
+ /* new_select->dscp = old_select->dscp; */
+ /* } */
bgp_zebra_announce(dest, p, new_select, bgp, afi, safi);
} else {
/* Withdraw the route from the kernel. */
@@ -8752,7 +8762,7 @@ static char *bgp_nexthop_hostname(struct peer *peer,
}
/* called from terminal list command */
-void route_vty_out(struct vty *vty, const struct prefix *p,
+void route_vty_out(struct vty *vty, const struct prefix *p, //
struct bgp_path_info *path, int display, safi_t safi,
json_object *json_paths, bool wide)
{
@@ -9143,6 +9153,7 @@ void route_vty_out(struct vty *vty, const struct prefix *p,
else
vty_out(vty, "%s", bgp_origin_str[attr->origin]);
+ /* vty_out(vty, " [dscp=%u]", attr->dscp); */
if (json_paths) {
if (bgp_evpn_is_esi_valid(&attr->esi)) {
json_object_string_add(json_path, "esi",
@@ -10820,7 +10831,7 @@ static int bgp_show_community(struct vty *vty, struct bgp *bgp,
const char *comstr, int exact, afi_t afi,
safi_t safi, uint16_t show_flags);
-static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
+static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi, //
struct bgp_table *table, enum bgp_show_type type,
void *output_arg, const char *rd, int is_last,
unsigned long *output_cum, unsigned long *total_cum,
@@ -10881,7 +10892,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
json_detail_header = true;
/* Start processing of routes. */
- for (dest = bgp_table_top(table); dest; dest = bgp_route_next(dest)) {
+ for (dest = bgp_table_top(table); dest; dest = bgp_route_next(dest)) { //
const struct prefix *dest_p = bgp_dest_get_prefix(dest);
enum rpki_states rpki_curr_state = RPKI_NOT_BEING_USED;
bool json_detail = json_detail_header;
@@ -11116,7 +11127,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
continue;
}
- if (!use_json && header) {
+ if (!use_json && header) { //
vty_out(vty,
"BGP table version is %" PRIu64
", local router ID is %pI4, vrf id ",
@@ -11140,7 +11151,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
|| type == bgp_show_type_flap_neighbor)
vty_out(vty, BGP_SHOW_FLAP_HEADER);
else
- vty_out(vty, (wide ? BGP_SHOW_HEADER_WIDE
+ vty_out(vty, (wide ? BGP_SHOW_HEADER_WIDE //
: BGP_SHOW_HEADER));
header = false;
@@ -11181,7 +11192,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
AFI_IP, safi, use_json,
json_paths);
else {
- if (CHECK_FLAG(show_flags, BGP_SHOW_OPT_DETAIL))
+ if (CHECK_FLAG(show_flags, BGP_SHOW_OPT_DETAIL)) //
route_vty_out_detail(
vty, bgp, dest, pi,
family2afi(dest_p->family),
@@ -11320,7 +11331,7 @@ int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi,
return CMD_SUCCESS;
}
-static int bgp_show(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
+static int bgp_show(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi, //
enum bgp_show_type type, void *output_arg,
uint16_t show_flags, enum rpki_states rpki_target_state)
{
@@ -12205,7 +12216,7 @@ DEFPY(show_ip_bgp_dampening_params, show_ip_bgp_dampening_params_cmd,
}
/* BGP route print out function */
-DEFPY(show_ip_bgp, show_ip_bgp_cmd,
+DEFPY(show_ip_bgp, show_ip_bgp_cmd, //
"show [ip] bgp [<view|vrf> VIEWVRFNAME] [" BGP_AFI_CMD_STR
" [" BGP_SAFI_WITH_LABEL_CMD_STR
"]]\
@@ -12668,7 +12679,7 @@ DEFUN (show_ip_bgp_regexp,
bgp_show_type_regexp, uj);
}
-DEFPY (show_ip_bgp_instance_all,
+DEFPY (show_ip_bgp_instance_all, //
show_ip_bgp_instance_all_cmd,
"show [ip] bgp <view|vrf> all ["BGP_AFI_CMD_STR" ["BGP_SAFI_WITH_LABEL_CMD_STR"]] [json$uj | wide$wide]",
SHOW_STR
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h
index 743b369bf..28bffc201 100644
--- a/bgpd/bgp_route.h
+++ b/bgpd/bgp_route.h
@@ -79,9 +79,8 @@ enum bgp_show_adj_route_type {
#define BGP_SHOW_NCODE_HEADER "Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self\n"
#define BGP_SHOW_RPKI_HEADER \
"RPKI validation codes: V valid, I invalid, N Not found\n\n"
-#define BGP_SHOW_HEADER " Network Next Hop Metric LocPrf Weight Path\n"
+#define BGP_SHOW_HEADER " Network Next Hop Metric LocPrf Weight Path\n" //
#define BGP_SHOW_HEADER_WIDE " Network Next Hop Metric LocPrf Weight Path\n"
-
/* Maximum number of labels we can process or send with a prefix. We
* really do only 1 for MPLS (BGP-LU) but we can do 2 for EVPN-VxLAN.
*/
@@ -317,6 +316,8 @@ struct bgp_path_info {
unsigned short instance;
+ /* uint8_t dscp; */
+
/* Addpath identifiers */
uint32_t addpath_rx_id;
struct bgp_addpath_info_data tx_addpath;
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 739aed17a..f601660f3 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -3065,6 +3065,7 @@ route_set_dscp(void *rule, const struct prefix *prefix, void *object)
path = object;
/* Set dscp value */
+ zlog_debug("QQQ map set_dscp [%d|%pFX|%p]", *rawDscp, prefix, path);
path->attr->dscp = *rawDscp;
return RMAP_OKAY;
diff --git a/bgpd/bgp_table.h b/bgpd/bgp_table.h
index d832383ab..376878a43 100644
--- a/bgpd/bgp_table.h
+++ b/bgpd/bgp_table.h
@@ -91,6 +91,44 @@ struct bgp_node {
*/
ROUTE_NODE_FIELDS
+#if 0
+#define ROUTE_NODE_FIELDS \
+ /* Actual prefix of this radix. */ \
+ struct prefix p; \
+ \
+struct prefix {
+ uint8_t family;
+ uint16_t prefixlen;
+ union {
+ uint8_t prefix;
+ struct in_addr prefix4;
+ struct in6_addr prefix6;
+ struct {
+ struct in_addr id;
+ struct in_addr adv_router;
+ } lp;
+ struct ethaddr prefix_eth; /* AF_ETHERNET */
+ uint8_t val[16];
+ uint32_t val32[4];
+ uintptr_t ptr;
+ struct evpn_addr prefix_evpn; /* AF_EVPN */
+ struct flowspec_prefix prefix_flowspec; /* AF_FLOWSPEC */
+ } u __attribute__((aligned(8)));
+};
+ /* Tree link. */ \
+ struct route_table *table_rdonly(table); \
+ struct route_node *table_rdonly(parent); \
+ struct route_node *table_rdonly(link[2]); \
+ \
+ /* Lock of this radix */ \
+ unsigned int table_rdonly(lock); \
+ \
+ struct rn_hash_node_item nodehash; \
+ /* Each node of route. */ \
+ void *info; \
+
+#endif
+
struct bgp_adj_out_rb adj_out;
struct bgp_adj_in *adj_in;
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 0a4083e5f..6074b5d8e 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -10325,7 +10325,7 @@ static bool bgp_show_summary_is_peer_filtered(struct peer *peer,
* sure `Desc` is the lastest column to show because it can contain
* whitespaces and the whole output will be tricky.
*/
-static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
+static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, //
struct peer *fpeer, int as_type, as_t as,
uint16_t show_flags)
{
@@ -11221,7 +11221,7 @@ int bgp_show_summary_vty(struct vty *vty, const char *name, afi_t afi,
}
/* `show [ip] bgp summary' commands. */
-DEFPY(show_ip_bgp_summary, show_ip_bgp_summary_cmd,
+DEFPY(show_ip_bgp_summary, show_ip_bgp_summary_cmd, //
"show [ip] bgp [<view|vrf> VIEWVRFNAME] [" BGP_AFI_CMD_STR
" [" BGP_SAFI_WITH_LABEL_CMD_STR
"]] [all$all] summary [established|failed] [<neighbor <A.B.C.D|X:X::X:X|WORD>|remote-as <(1-4294967295)|internal|external>>] [terse] [wide] [json$uj]",
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 1a9770ab2..4945da856 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -1317,6 +1317,7 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
tag = info->attr->tag;
dscp = info->attr->dscp;
+ zlog_debug("QQQ Announce [tag=%d|dscp=%d]", tag, dscp);
/* If the route's source is EVPN, flag as such. */
is_evpn = is_route_parent_evpn(info);
@@ -1424,6 +1425,7 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
metric = mpinfo_cp->attr->med;
tag = mpinfo_cp->attr->tag;
dscp = mpinfo_cp->attr->dscp;
+ zlog_debug("QQQ Override [%d|%d|%d]", metric, tag, dscp);
}
}
@@ -1558,10 +1560,12 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
api.dscp = dscp;
}
+ zlog_debug("QQQ if tag [%d|%d|%d]", metric, tag, dscp);
if (tag) {
SET_FLAG(api.message, ZAPI_MESSAGE_TAG);
api.tag = tag;
}
+ zlog_debug("QQQ bgp_zebra set DSCP API [dscp %d|tag %d|%pFX|%p]", api.dscp, tag, p, info);
distance = bgp_distance_apply(p, info, afi, safi, bgp);
if (distance) {
@@ -1672,11 +1676,13 @@ void bgp_zebra_announce_table(struct bgp *bgp, afi_t afi, safi_t safi)
(pi->type == ZEBRA_ROUTE_BGP
&& (pi->sub_type == BGP_ROUTE_NORMAL
- || pi->sub_type == BGP_ROUTE_IMPORTED)))
+ || pi->sub_type == BGP_ROUTE_IMPORTED))) {
+ zlog_debug("QQQ Announce bgp_zebra_announce_table");
bgp_zebra_announce(dest,
bgp_dest_get_prefix(dest),
pi, bgp, afi, safi);
+ }
}
/* Announce routes of any bgp subtype of a table to zebra */
@@ -1697,10 +1703,12 @@ void bgp_zebra_announce_table_all_subtypes(struct bgp *bgp, afi_t afi,
for (dest = bgp_table_top(table); dest; dest = bgp_route_next(dest))
for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next)
if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED) &&
- pi->type == ZEBRA_ROUTE_BGP)
+ pi->type == ZEBRA_ROUTE_BGP) {
+ zlog_debug("QQQ Announce bgp_zebra_announce_table_all");
bgp_zebra_announce(dest,
bgp_dest_get_prefix(dest),
pi, bgp, afi, safi);
+ }
}
void bgp_zebra_withdraw(const struct prefix *p, struct bgp_path_info *info,
diff --git a/debian/rules b/debian/rules
index d5add314f..a25f75fa6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -118,8 +118,8 @@ override_dh_installsystemd:
override_dh_makeshlibs:
dh_makeshlibs -n
-override_dh_missing:
- dh_missing --fail-missing
+# override_dh_missing:
+# dh_missing --fail-missing
override_dh_auto_clean:
# we generally do NOT want a full distclean since that wipes both
diff --git a/lib/routemap.c b/lib/routemap.c
index 387c91bf0..505796dff 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -431,6 +431,7 @@ void route_map_set_dscp_hook(int (*func)(struct route_map_index *index,
char *errmsg, size_t errmsg_len))
{
+ zlog_debug("QQQ Set dscp hook");
rmap_match_set_hook.set_dscp = func;
}
@@ -440,6 +441,7 @@ void route_map_no_set_dscp_hook(int (*func)(struct route_map_index *index,
const char *arg,
char *errmsg, size_t errmsg_len))
{
+ zlog_debug("QQQ Unset dscp hook");
rmap_match_set_hook.no_set_dscp = func;
}
@@ -3335,6 +3337,7 @@ void *route_map_rule_dscp_compile(const char *dscp)
bool isANumber = true;
uint8_t *rawDscp, tmpDscp;
+ zlog_debug("QQQ compile dscp %s", dscp);
for (int i = 0; i < (int)strlen(dscp); i++) {
/* Letters are not numbers */
if (!isdigit(dscp[i]))
@@ -3370,11 +3373,13 @@ void *route_map_rule_dscp_compile(const char *dscp)
}
*rawDscp = (*rawDscp << 2);
+ zlog_debug("QQQ rawDscp %d", *rawDscp);
return rawDscp;
}
void route_map_rule_dscp_free(void *rule)
{
+ zlog_debug("QQQ map dscp free");
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
diff --git a/lib/zclient.c b/lib/zclient.c
index 612d35ce8..f4cbaaa25 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -1326,6 +1326,7 @@ int zapi_route_encode(uint8_t cmd, struct stream *s, struct zapi_route *api)
stream_putl(s, api->metric);
if (CHECK_FLAG(api->message, ZAPI_MESSAGE_DSCP))
stream_putl(s, api->dscp);
+ zlog_debug("QQQ ENCODE DSCP [%d]", api->dscp);
if (CHECK_FLAG(api->message, ZAPI_MESSAGE_TAG))
stream_putl(s, api->tag);
if (CHECK_FLAG(api->message, ZAPI_MESSAGE_MTU))
@@ -1571,6 +1572,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
STREAM_GETL(s, api->metric);
if (CHECK_FLAG(api->message, ZAPI_MESSAGE_DSCP))
STREAM_GETL(s, api->dscp);
+ zlog_debug("QQQ DECODE DSCP [%d]", api->dscp);
if (CHECK_FLAG(api->message, ZAPI_MESSAGE_TAG))
STREAM_GETL(s, api->tag);
if (CHECK_FLAG(api->message, ZAPI_MESSAGE_MTU))
diff --git a/pbrd/pbr_map.c b/pbrd/pbr_map.c
index 5daac55de..db172d357 100644
--- a/pbrd/pbr_map.c
+++ b/pbrd/pbr_map.c
@@ -445,7 +445,7 @@ static void pbr_map_add_interfaces(struct pbr_map *pbrm)
}
/* Decodes a standardized DSCP into its representative value */
-uint8_t pbr_map_decode_dscp_enum(const char *name)
+uint8_t pbr_map_decode_dscp_enum(const char *name) //
{
/* Standard Differentiated Services Field Codepoints */
if (!strcmp(name, "cs0"))
diff --git a/tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py b/tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py
index b18e32f6b..bd52edd10 100644
--- a/tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py
+++ b/tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py
@@ -152,6 +152,7 @@ def setup_module(mod):
)
logger.info("Running setup_module() done")
+ # import pdb; pdb.set_trace()
def teardown_module():
@@ -537,7 +538,9 @@ def test_advertise_network_using_network_command(request):
}
}
+ # import pdb; pdb.set_trace()
result = create_router_bgp(tgen, topo, input_dict)
+ import pdb; pdb.set_trace()
assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)
# Verifying RIB routes
@@ -816,6 +819,7 @@ def test_BGP_attributes_with_vrf_default_keyword_p0(request):
tc_name, result
)
+ import pdb; pdb.set_trace()
write_test_footer(tc_name)
diff --git a/tests/topotests/bgp_default_route_route_map_set/test_bgp_default-originate_route-map_set.py b/tests/topotests/bgp_default_route_route_map_set/test_bgp_default-originate_route-map_set.py
index cc2243a1c..33ede0000 100644
--- a/tests/topotests/bgp_default_route_route_map_set/test_bgp_default-originate_route-map_set.py
+++ b/tests/topotests/bgp_default_route_route_map_set/test_bgp_default-originate_route-map_set.py
@@ -105,6 +105,7 @@ def test_bgp_default_originate_route_map():
assert (
result is None
), 'Failed to see applied metric for default route in "{}"'.format(router)
+ import pdb; pdb.set_trace()
if __name__ == "__main__":
diff --git a/tests/topotests/bgp_features/test_bgp_features.py b/tests/topotests/bgp_features/test_bgp_features.py
index ab44ba3c8..8b4254afa 100644
--- a/tests/topotests/bgp_features/test_bgp_features.py
+++ b/tests/topotests/bgp_features/test_bgp_features.py
@@ -458,6 +458,7 @@ def test_bgp_metric_config():
"'set metric 222' configuration applied to R2, but not visible in configuration"
)
assert setmetric222 == " set metric 222", assertmsg
+ import pdb; pdb.set_trace()
def test_bgp_metric_add_config():
diff --git a/tests/topotests/static_routing_with_ebgp/test_static_routes_topo1_ebgp.py b/tests/topotests/static_routing_with_ebgp/test_static_routes_topo1_ebgp.py
index abfba029f..eafa01614 100644
--- a/tests/topotests/static_routing_with_ebgp/test_static_routes_topo1_ebgp.py
+++ b/tests/topotests/static_routing_with_ebgp/test_static_routes_topo1_ebgp.py
@@ -1319,6 +1319,7 @@ def test_same_rte_from_bgp_static_p0_tc5_ebgp(request):
), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name)
write_test_footer(tc_name)
+ import pdb; pdb.set_trace()
if __name__ == "__main__":
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 7b09349b5..ce91d2ad0 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -783,7 +783,7 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
flags |= ZEBRA_FLAG_OFFLOADED;
if (rtm->rtm_flags & RTM_F_OFFLOAD_FAILED)
flags |= ZEBRA_FLAG_OFFLOAD_FAILED;
-#if 0
+#if 1
if (rtm->rtm_flags & RTM_F_DSCP) {
zlog_debug("QQQ DSCP DETECTED %d", dscp);
}
@@ -954,6 +954,7 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
re->tag = tag;
re->nhe_id = nhe_id;
re->dscp = 0;
+ zlog_debug("QQQ MULTIPATH? re %d", re->dscp);
if (!nhe_id) {
uint8_t nhop_num;
@@ -1970,6 +1971,7 @@ ssize_t netlink_route_multipath_msg_encode(int cmd,
if (req->r.rtm_tos)
req->r.rtm_flags |= RTM_F_DSCP;
+ zlog_debug("QQQ NETLINK send dscp %d", req->r.rtm_tos);
if (cmd == RTM_DELROUTE)
req->r.rtm_protocol = zebra2proto(dplane_ctx_get_old_type(ctx));
else
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
index e645d07be..7050ea480 100644
--- a/zebra/zebra_dplane.c
+++ b/zebra/zebra_dplane.c
@@ -2524,6 +2524,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op,
ctx->zd_table_id = re->table;
+ zlog_debug("QQQ ctx dscp %d", re->dscp);
ctx->u.rinfo.zd_metric = re->metric;
ctx->u.rinfo.zd_old_metric = re->metric;
ctx->u.rinfo.zd_dscp = re->dscp;
@@ -3246,6 +3247,7 @@ dplane_route_update_internal(struct route_node *rn,
ctx = dplane_ctx_alloc();
/* Init context with info from zebra data structs */
+ zlog_debug("DPLANE ctx create");
ret = dplane_ctx_route_init(ctx, op, rn, re);
if (ret == AOK) {
/* Capture some extra info for update case
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index b6faafc1e..e9bd87cbb 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -2143,6 +2143,7 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx)
bool debug_p = IS_ZEBRA_DEBUG_DPLANE | IS_ZEBRA_DEBUG_RIB;
int start_count, end_count;
+ zlog_debug("QQQ DEBUG rib_process_dplane_notify");
vrf = vrf_lookup_by_id(dplane_ctx_get_vrf(ctx));
/* Locate rn and re(s) from ctx */
@@ -3820,6 +3821,7 @@ int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
struct route_entry *re = NULL;
struct nexthop *nexthop = NULL;
struct nexthop_group *ng = NULL;
+ /* QQQ DSCP */
int dscp = 0;
/* Allocate new route_entry structure. */
@@ -3836,6 +3838,7 @@ int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
re->tag = tag;
re->nhe_id = nhe_id;
re->dscp = dscp;
+ zlog_debug("QQQ NEW re %d", re->dscp);
/* If the owner of the route supplies a shared nexthop-group id,
* we'll use that. Otherwise, pass the nexthop along directly.
@@ -3892,8 +3895,8 @@ static void rib_update_route_node(struct route_node *rn, int type)
}
/* Schedule routes of a particular table (address-family) based on event. */
-void rib_update_table(struct route_table *table, enum rib_update_event event,
- int rtype)
+void rib_update_table(struct route_table *table, enum rib_update_event event, //
+ int rtype) //
{
struct route_node *rn;
@@ -3930,7 +3933,7 @@ void rib_update_table(struct route_table *table, enum rib_update_event event,
switch (event) {
case RIB_UPDATE_KERNEL:
- rib_update_route_node(rn, ZEBRA_ROUTE_KERNEL);
+ rib_update_route_node(rn, ZEBRA_ROUTE_KERNEL); //
break;
case RIB_UPDATE_RMAP_CHANGE:
case RIB_UPDATE_OTHER:
@@ -3971,7 +3974,7 @@ static void rib_update_handle_vrf_all(enum rib_update_event event, int rtype)
/* Just iterate over all the route tables, rather than vrf lookups */
RB_FOREACH (zrt, zebra_router_table_head, &zrouter.tables)
- rib_update_table(zrt->table, event, rtype);
+ rib_update_table(zrt->table, event, rtype); //
}
struct rib_update_ctx {
@@ -4029,8 +4032,8 @@ void rib_update(enum rib_update_event event)
ctx = rib_update_ctx_init(0, event);
ctx->vrf_all = true;
- thread_add_event(zrouter.master, rib_update_handler, ctx, 0,
- &t_rib_update_threads[event]);
+ thread_add_event(zrouter.master, rib_update_handler, ctx, 0, //
+ &t_rib_update_threads[event]); //
if (IS_ZEBRA_DEBUG_EVENT)
zlog_debug("%s: Scheduled VRF (ALL), event %s", __func__,
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 4bf724456..ca20dbda8 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -19,6 +19,7 @@
*/
#include <zebra.h>
+#include <string.h>
#include "memory.h"
#include "if.h"
@@ -195,7 +196,7 @@ DEFUN (show_ip_rpf_addr,
return CMD_SUCCESS;
}
-static char re_status_output_char(const struct route_entry *re,
+static char re_status_output_char(const struct route_entry *re, //
const struct nexthop *nhop,
bool is_fib)
{
@@ -941,7 +942,7 @@ static void show_nexthop_json_helper(json_object *json_nexthop,
}
}
-static void vty_show_ip_route(struct vty *vty, struct route_node *rn,
+static void vty_show_ip_route(struct vty *vty, struct route_node *rn, //
struct route_entry *re, json_object *json,
bool is_fib, bool show_ng)
{
@@ -1085,7 +1086,7 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn,
nhg_from_backup = true;
}
- len = vty_out(vty, "%c", zebra_route_char(re->type));
+ len = vty_out(vty, "%c", zebra_route_char(re->type)); //
if (re->instance)
len += vty_out(vty, "[%d]", re->instance);
if (nhg_from_backup && nhg->nexthop) {
@@ -1106,7 +1107,7 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn,
if (((re->type == ZEBRA_ROUTE_CONNECT) &&
(re->distance || re->metric)) ||
(re->type != ZEBRA_ROUTE_CONNECT))
- len += vty_out(vty, " [%u/%u]", re->distance,
+ len += vty_out(vty, " [%u/%u]", re->distance, //
re->metric);
if (show_ng)

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
14/8d/48cf760987fc77deba2f37719705
Default Alt Text
frr_debug.patch (23 KB)

Event Timeline