diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2022-02-23 08:05:47 +0100 |
---|---|---|
committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2022-02-25 09:02:30 +0100 |
commit | 9a706b42fb968795a9e2aeed53a2b164de846c77 (patch) | |
tree | 361794995dc88698b00d9a834e1de33d89f4f930 /bgpd/bgp_evpn_vty.c | |
parent | Merge pull request #10615 from mobash-rasool/fixes (diff) | |
download | frr-9a706b42fb968795a9e2aeed53a2b164de846c77.tar.xz frr-9a706b42fb968795a9e2aeed53a2b164de846c77.zip |
bgpd: Reuse get/set helpers for attr->community
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'bgpd/bgp_evpn_vty.c')
-rw-r--r-- | bgpd/bgp_evpn_vty.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index caf044485..d56f4f207 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -1236,6 +1236,10 @@ static int bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd, no_display = 0; for (; pi; pi = pi->next) { + struct community *picomm = NULL; + + picomm = bgp_attr_get_community(pi->attr); + total_count++; if (type == bgp_show_type_neighbor) { struct peer *peer = output_arg; @@ -1268,17 +1272,15 @@ static int bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd, if (type == bgp_show_type_community) { struct community *com = output_arg; - if (!pi->attr->community || - !community_match( - pi->attr->community, com)) + if (!picomm || + !community_match(picomm, com)) continue; } if (type == bgp_show_type_community_exact) { struct community *com = output_arg; - if (!pi->attr->community || - !community_cmp( - pi->attr->community, com)) + if (!picomm || + !community_cmp(picomm, com)) continue; } if (header) { |