]> git.proxmox.com Git - mirror_frr.git/commit - bgpd/bgp_fsm.c
bgpd: correctly schedule select() at session startup
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 6 Apr 2017 23:45:57 +0000 (23:45 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 30 Nov 2017 21:17:58 +0000 (16:17 -0500)
commitdc1188bb4d5be4df3f04a5448b85d23b895bd7db
treecbe9fccd333e6a5cfa957869f32752f26346b9f7
parent727c4f870b0e6079b761afc525f6a1f5262bcf9f
bgpd: correctly schedule select() at session startup

On TCP connection failure during session setup, bgp_stop() checks
whether peer->t_read is non-null to know whether or not to unschedule
select() on peer->fd before calling close() on it. Using the API exposed
by thread.c instead of bgpd's wrapper macro BGP_READ_ON() results in
this thread value never being set, which causes bgp_stop() to skip the
cancellation of select() before calling close(). Subsequent calls to
select() on that fd crash the daemon.

Use the macro instead.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_fsm.c