]> git.ipfire.org Git - thirdparty/FORT-validator.git/commit
RTR Server: poll before writing
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Wed, 14 Jul 2021 15:25:43 +0000 (10:25 -0500)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Wed, 14 Jul 2021 15:25:43 +0000 (10:25 -0500)
commit62eb0242dc21eb68661af4889f91a06846543d05
treef6598520c27ef0d8b1b2bd947420d12a98c2eb21
parent23478fdff80e8ceeaeeaffc71880f950b3c71104
RTR Server: poll before writing

Problem:

write() was sometimes failing with EAGAIN when Fort tried to send PDUs
to clients.

Diagnosis:

Obviously, it's because RTR client sockets now ship with O_NONBLOCK
enabled. Fort wants O_NONBLOCK for reading, but not for writing.

This bug was introduced in the previous commit.

Solution:

Make sure the socket is writable (via poll()) before calling write().
src/rtr/pdu_sender.c
src/rtr/rtr.c