afi, safi, rmap_name);
if (type == bgp_show_adj_route_filtered
- && ret != RMAP_DENY)
+ && ret != RMAP_DENY) {
+ bgp_attr_undup(&attr, ain->attr);
continue;
+ }
if (type == bgp_show_adj_route_received
&& ret == RMAP_DENY)
route_vty_out_tmp(vty, &rn->p, &attr, safi,
use_json, json_ar);
+ bgp_attr_undup(&attr, ain->attr);
output_count++;
}
} else if (type == bgp_show_adj_route_advertised) {
for (adj = rn->adj_out; adj; adj = adj->next)
SUBGRP_FOREACH_PEER (adj->subgroup, paf) {
- if (paf->peer != peer)
+ if (paf->peer != peer || !adj->attr)
continue;
if (header1) {
}
header1 = 0;
}
-
if (header2) {
if (!use_json)
vty_out(vty,
header2 = 0;
}
- if (adj->attr) {
- bgp_attr_dup(&attr, adj->attr);
- ret = bgp_output_modifier(
- peer, &rn->p, &attr,
- afi, safi, rmap_name);
- if (ret != RMAP_DENY) {
- route_vty_out_tmp(
- vty, &rn->p,
- &attr, safi,
- use_json,
- json_ar);
- output_count++;
- } else
- filtered_count++;
-
- bgp_attr_undup(&attr,
- adj->attr);
+ bgp_attr_dup(&attr, adj->attr);
+ ret = bgp_output_modifier(
+ peer, &rn->p, &attr, afi, safi,
+ rmap_name);
+
+ if (ret != RMAP_DENY) {
+ route_vty_out_tmp(vty, &rn->p,
+ &attr, safi,
+ use_json,
+ json_ar);
+ output_count++;
+ } else {
+ filtered_count++;
}
+
+ bgp_attr_undup(&attr, adj->attr);
}
}
}