]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: stop pseudo-blocking in bgp_write
authorQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 31 Mar 2017 16:55:52 +0000 (16:55 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 30 Nov 2017 21:17:58 +0000 (16:17 -0500)
If write() indicates that we should retry, just move along to the next
peer and come back later. No need to burn write() in a loop.

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

index 0ff74a5ade36d2b86e12af845a71c985ecb133b3..02ea92a4d122a5039eb2f8a67414df5fa479ddfb 100644 (file)
@@ -2202,10 +2202,9 @@ static int bgp_write(struct peer *peer)
                        num = write(peer->fd, STREAM_PNT(s), writenum);
 
                        if (num < 0) {
-                               if (ERRNO_IO_RETRY(errno))
-                                       continue;
+                               if (!ERRNO_IO_RETRY(errno))
+                                       BGP_EVENT_ADD(peer, TCP_fatal_error);
 
-                               BGP_EVENT_ADD(peer, TCP_fatal_error);
                                goto done;
                        } else if (num != writenum) // incomplete write
                                stream_forward_getp(s, num);