mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 09:20:25 +00:00
bgpd: honor max prefix timer on inbound sessions
When using the maximum-prefix restart option with a BGP peer, if the peer exceeds the limit of prefixes, bgpd causes the connection to be closed and sets a timer. It will not attempt to connect to that peer until the timer expires. But if the peer attempts to connect to it before the timer expires, it accepts the connection and starts exchanging routes again. When accepting a connection from a peer, reject the connection if the max prefix restart timer is set. Signed-off-by: Matthew Smith <mgsmith@netgate.com>
This commit is contained in:
parent
f85d5e3d97
commit
497b686a49
@ -440,6 +440,17 @@ static int bgp_accept(struct thread *thread)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check whether max prefix restart timer is set for the peer */
|
||||||
|
if (peer1->t_pmax_restart) {
|
||||||
|
if (bgp_debug_neighbor_events(peer1))
|
||||||
|
zlog_debug(
|
||||||
|
"%s - incoming conn rejected - "
|
||||||
|
"peer max prefix timer is active",
|
||||||
|
peer1->host);
|
||||||
|
close(bgp_sock);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (bgp_debug_neighbor_events(peer1))
|
if (bgp_debug_neighbor_events(peer1))
|
||||||
zlog_debug("[Event] BGP connection from host %s fd %d",
|
zlog_debug("[Event] BGP connection from host %s fd %d",
|
||||||
inet_sutop(&su, buf), bgp_sock);
|
inet_sutop(&su, buf), bgp_sock);
|
||||||
|
Loading…
Reference in New Issue
Block a user