mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-15 06:45:25 +00:00
Merge pull request #1508 from qlyoung/bgpd-fix-lock
bgpd: fix potential deadlock
This commit is contained in:
commit
6bbda63df7
@ -556,12 +556,14 @@ static int bgp_write_notify(struct peer *peer)
|
|||||||
{
|
{
|
||||||
/* There should be at least one packet. */
|
/* There should be at least one packet. */
|
||||||
s = stream_fifo_pop(peer->obuf);
|
s = stream_fifo_pop(peer->obuf);
|
||||||
if (!s)
|
|
||||||
return 0;
|
|
||||||
assert(stream_get_endp(s) >= BGP_HEADER_SIZE);
|
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&peer->io_mtx);
|
pthread_mutex_unlock(&peer->io_mtx);
|
||||||
|
|
||||||
|
if (!s)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
assert(stream_get_endp(s) >= BGP_HEADER_SIZE);
|
||||||
|
|
||||||
/* Stop collecting data within the socket */
|
/* Stop collecting data within the socket */
|
||||||
sockopt_cork(peer->fd, 0);
|
sockopt_cork(peer->fd, 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user