mirror of https://github.com/FRRouting/frr.git
Merge pull request #12732 from donaldsharp/fix_bgp_open_issues
bgpd: Don't try to recursively hold peer io mutex
This commit is contained in:
commit
9d5c511864
|
@ -173,12 +173,11 @@ static int read_ibuf_work(struct peer *peer)
|
|||
uint16_t pktsize = 0;
|
||||
struct stream *pkt;
|
||||
|
||||
/* Hold the I/O lock, we might not have space on the InQ */
|
||||
frr_mutex_lock_autounlock(&peer->io_mtx);
|
||||
/* ============================================== */
|
||||
|
||||
frr_with_mutex (&peer->io_mtx) {
|
||||
if (peer->ibuf->count >= bm->inq_limit)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* check that we have enough data for a header */
|
||||
if (ringbuf_remain(ibw) < BGP_HEADER_SIZE)
|
||||
|
@ -211,7 +210,9 @@ static int read_ibuf_work(struct peer *peer)
|
|||
stream_set_endp(pkt, pktsize);
|
||||
|
||||
frrtrace(2, frr_bgp, packet_read, peer, pkt);
|
||||
frr_with_mutex (&peer->io_mtx) {
|
||||
stream_fifo_push(peer->ibuf, pkt);
|
||||
}
|
||||
|
||||
return pktsize;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue