]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: Respect AFI/SAFI when hard-clearing a peer
authorPascal Mathis <mail@pascalmathis.com>
Mon, 14 May 2018 20:52:31 +0000 (22:52 +0200)
committerPascal Mathis <mail@pascalmathis.com>
Mon, 14 May 2018 20:52:31 +0000 (22:52 +0200)
commit3ae8bfa5d870d103325cf879a501758e217c6a89
tree7bd04994ce5e6ec61eff9cb51bc53915950559e8
parent62362d70aac9f70a2563ae7e5d4448b05c38d2da
bgpd: Respect AFI/SAFI when hard-clearing a peer

The current implementation does not respect the AFI+SAFI combination of
a peer when executing a non-soft (hard) clear. An example would be the
command `clear bgp ipv4 unicast *`, which will clear all BGP peers, even
those that do not have IPv4-Unicast activated.

This commit fixes that behavior by applying the same rules to both soft
and hard clear commands, so that peers without a matching AFI+SAFI
combination will be no longer modified.

Additionally, this commit adds warning messages to all `clear bgp
[<afi>] [<safi>] <target>` commands when no matching peers with the given
AFI+SAFI combination could be found.

Both existing and new warning messages have been extended to also
mention the AFI+SAFI combination that is missing, which is more helpful
to the user than a generic expression 'No peer configured'.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
bgpd/bgp_vty.c