X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=bgpd%2Fbgp_flowspec_vty.c;h=80384c12c628bd0a50545a0b3c242a134c6ae7f2;hb=794b37d521176053ca1b1177a367333f1fc5c280;hp=72ee8bb4cee14c8b9c72506128ab752db65c2f9d;hpb=4634d02cfd86685156b29c8084a979749efe15e2;p=mirror_frr.git diff --git a/bgpd/bgp_flowspec_vty.c b/bgpd/bgp_flowspec_vty.c index 72ee8bb4c..80384c12c 100644 --- a/bgpd/bgp_flowspec_vty.c +++ b/bgpd/bgp_flowspec_vty.c @@ -294,7 +294,7 @@ void route_vty_out_flowspec(struct vty *vty, struct prefix *p, } if (!path) return; - if (path->attr && path->attr->ecommunity) { + if (path->attr->ecommunity) { /* Print attribute */ attr = path->attr; s = ecommunity_ecom2str(attr->ecommunity, @@ -332,14 +332,12 @@ void route_vty_out_flowspec(struct vty *vty, struct prefix *p, if (display == NLRI_STRING_FORMAT_LARGE) { struct bgp_path_info_extra *extra = bgp_path_info_extra_get(path); + bool list_began = false; - if (listcount(extra->bgp_fs_pbr) || - listcount(extra->bgp_fs_iprule)) { + if (extra->bgp_fs_pbr && listcount(extra->bgp_fs_pbr)) { struct listnode *node; struct bgp_pbr_match_entry *bpme; - struct bgp_pbr_rule *bpr; struct bgp_pbr_match *bpm; - bool list_began = false; struct list *list_bpm; list_bpm = list_new(); @@ -357,6 +355,14 @@ void route_vty_out_flowspec(struct vty *vty, struct prefix *p, 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) @@ -373,8 +379,8 @@ void route_vty_out_flowspec(struct vty *vty, struct prefix *p, 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"); } }