}
if (!path)
return;
- if (path->attr && path->attr->ecommunity) {
+ if (path->attr->ecommunity) {
/* Print attribute */
attr = path->attr;
s = ecommunity_ecom2str(attr->ecommunity,
}
if (attr->nexthop.s_addr != 0 &&
display == NLRI_STRING_FORMAT_LARGE)
- vty_out(vty, "\tNH %-16s\n", inet_ntoa(attr->nexthop));
+ vty_out(vty, "\tNLRI NH %-16s\n",
+ inet_ntoa(attr->nexthop));
XFREE(MTYPE_ECOMMUNITY_STR, s);
}
peer_uptime(path->uptime, timebuf, BGP_UPTIME_LEN, 0, NULL);
if (display == NLRI_STRING_FORMAT_LARGE) {
struct bgp_path_info_extra *extra =
bgp_path_info_extra_get(path);
+ bool list_began = false;
- if (extra->bgp_fs_pbr) {
+ if (extra->bgp_fs_pbr && listcount(extra->bgp_fs_pbr)) {
struct listnode *node;
struct bgp_pbr_match_entry *bpme;
struct bgp_pbr_match *bpm;
- bool list_began = false;
struct list *list_bpm;
list_bpm = list_new();
- if (listcount(extra->bgp_fs_pbr))
- vty_out(vty, "\tinstalled in PBR");
+ vty_out(vty, "\tinstalled in PBR");
for (ALL_LIST_ELEMENTS_RO(extra->bgp_fs_pbr,
node, bpme)) {
bpm = bpme->backpointer;
vty_out(vty, ", ");
vty_out(vty, "%s", bpm->ipset_name);
}
+ list_delete(&list_bpm);
+ }
+ if (extra->bgp_fs_iprule && listcount(extra->bgp_fs_iprule)) {
+ struct listnode *node;
+ struct bgp_pbr_rule *bpr;
+
+ if (!list_began)
+ vty_out(vty, "\tinstalled in PBR");
+ for (ALL_LIST_ELEMENTS_RO(extra->bgp_fs_iprule,
+ node, bpr)) {
+ if (!bpr->action)
+ continue;
+ if (!list_began) {
+ vty_out(vty, " (");
+ list_began = true;
+ } else
+ vty_out(vty, ", ");
+ vty_out(vty, "-ipv4-rule %d action lookup %u-",
+ bpr->priority,
+ bpr->action->table_id);
+ }
if (list_began)
vty_out(vty, ")");
vty_out(vty, "\n");
- list_delete(&list_bpm);
- } else
+ }
+ if (!list_began)
vty_out(vty, "\tnot installed in PBR\n");
}
}
return CMD_SUCCESS;
for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
- if (rn->info == NULL)
+ pi = bgp_node_get_bgp_path_info(rn);
+ if (pi == NULL)
continue;
if (use_json) {
json_paths = json_object_new_array();
display = NLRI_STRING_FORMAT_JSON;
}
- for (pi = rn->info; pi; pi = pi->next) {
+ for (; pi; pi = pi->next) {
total_count++;
route_vty_out_flowspec(vty, &rn->p, pi, display,
json_paths);
continue;
if (bgp_flowspec_contains_prefix(prefix, match, prefix_check)) {
- route_vty_out_flowspec(vty, &rn->p,
- rn->info, use_json ?
- NLRI_STRING_FORMAT_JSON :
- NLRI_STRING_FORMAT_LARGE,
- json_paths);
+ route_vty_out_flowspec(
+ vty, &rn->p, bgp_node_get_bgp_path_info(rn),
+ use_json ? NLRI_STRING_FORMAT_JSON
+ : NLRI_STRING_FORMAT_LARGE,
+ json_paths);
display++;
}
}