bgpd: if bgp peer inherit group password, it should set md5

Signed-off-by: guozhongfeng.gzf <guozhongfeng.gzf@alibaba-inc.com>
This commit is contained in:
guozhongfeng.gzf 2025-03-19 15:53:34 +08:00
parent ee5a3456d3
commit 88840e04c2

View file

@ -6952,7 +6952,10 @@ int peer_password_unset(struct peer *peer)
/* Attempt to uninstall password on socket. */
if (!BGP_CONNECTION_SU_UNSPEC(peer->connection))
bgp_md5_unset(peer->connection);
if (CHECK_FLAG(peer->flags, PEER_FLAG_PASSWORD))
bgp_md5_set(peer->connection);
else
bgp_md5_unset(peer->connection);
/* Skip peer-group mechanics for regular peers. */
return 0;
}