diff options
author | Daniel Walton <dwalton@cumulusnetworks.com> | 2017-07-26 19:49:20 +0200 |
---|---|---|
committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2017-07-26 19:49:20 +0200 |
commit | 8eeb033552d839da56b4d417006bfb1ec43a1bc3 (patch) | |
tree | 36c2e0ca03b9bd20219d3692467068803ed7be72 /bgpd/bgpd.c | |
parent | *: fix git-reindent-branch.py reversing order (diff) | |
download | frr-8eeb033552d839da56b4d417006bfb1ec43a1bc3.tar.xz frr-8eeb033552d839da56b4d417006bfb1ec43a1bc3.zip |
bgpd: attribute-unchanged issues with peer-groups
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r-- | bgpd/bgpd.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 3453da665..a0e2d6749 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -6926,36 +6926,34 @@ static void bgp_config_write_peer_af(struct vty *vty, struct bgp *bgp, bgp_config_write_filter(vty, peer, afi, safi, write); /* atribute-unchanged. */ - if (CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_AS_PATH_UNCHANGED) - || CHECK_FLAG(peer->af_flags[afi][safi], - PEER_FLAG_NEXTHOP_UNCHANGED) - || CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_MED_UNCHANGED)) { - if (peergroup_af_flag_check(peer, afi, safi, - PEER_FLAG_AS_PATH_UNCHANGED) - && peergroup_af_flag_check(peer, afi, safi, - PEER_FLAG_NEXTHOP_UNCHANGED) - && peergroup_af_flag_check(peer, afi, safi, - PEER_FLAG_MED_UNCHANGED)) { - afi_header_vty_out( - vty, afi, safi, write, - " neighbor %s attribute-unchanged\n", addr); - } else { + if (peer_af_flag_check(peer, afi, safi, PEER_FLAG_AS_PATH_UNCHANGED) || + peer_af_flag_check(peer, afi, safi, PEER_FLAG_NEXTHOP_UNCHANGED) || + peer_af_flag_check(peer, afi, safi, PEER_FLAG_MED_UNCHANGED)) { + + if (!peer_group_active(peer) || + peergroup_af_flag_check(peer, afi, safi, + PEER_FLAG_AS_PATH_UNCHANGED) || + peergroup_af_flag_check(peer, afi, safi, + PEER_FLAG_NEXTHOP_UNCHANGED) || + peergroup_af_flag_check(peer, afi, safi, + PEER_FLAG_MED_UNCHANGED)) { + afi_header_vty_out( vty, afi, safi, write, " neighbor %s attribute-unchanged%s%s%s\n", addr, - peergroup_af_flag_check( + peer_af_flag_check( peer, afi, safi, PEER_FLAG_AS_PATH_UNCHANGED) ? " as-path" : "", - peergroup_af_flag_check( + peer_af_flag_check( peer, afi, safi, PEER_FLAG_NEXTHOP_UNCHANGED) ? " next-hop" : "", - peergroup_af_flag_check(peer, afi, safi, - PEER_FLAG_MED_UNCHANGED) + peer_af_flag_check(peer, afi, safi, + PEER_FLAG_MED_UNCHANGED) ? " med" : ""); } |