From a32bc346c6b53e49fb963fe092da39dc00db5c71 Mon Sep 17 00:00:00 2001 From: Edwin Groothuis Date: Mon, 22 Nov 2004 04:33:32 +0000 Subject: Attached patch comes from official quagga developer list. It fixes the problem with bgpd lockup when remote peer dies. Patch is tested by many people. Here is also some cleanup to Makefile to remove unused variable. Please commit it. Submitted by: Boris Kovalenko --- net/quagga/files/patch-bgpd::bgp_packet.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 net/quagga/files/patch-bgpd::bgp_packet.c (limited to 'net/quagga/files/patch-bgpd::bgp_packet.c') diff --git a/net/quagga/files/patch-bgpd::bgp_packet.c b/net/quagga/files/patch-bgpd::bgp_packet.c new file mode 100644 index 000000000000..c54a139301a7 --- /dev/null +++ b/net/quagga/files/patch-bgpd::bgp_packet.c @@ -0,0 +1,25 @@ +--- bgpd/bgp_packet.c.orig Mon Nov 22 15:31:07 2004 ++++ bgpd/bgp_packet.c Mon Nov 22 15:31:40 2004 +@@ -566,17 +566,22 @@ + while (1) + { + int writenum; ++ int val; + + s = bgp_write_packet (peer); + if (! s) + return 0; + ++ val = fcntl (peer->fd, F_GETFL, 0); ++ fcntl (peer->fd, F_SETFL, val|O_NONBLOCK); ++ + /* Number of bytes to be sent. */ + writenum = stream_get_endp (s) - stream_get_getp (s); + + /* Call write() system call. */ + num = write (peer->fd, STREAM_PNT (s), writenum); + write_errno = errno; ++ fcntl (peer->fd, F_SETFL, val); + if (num <= 0) + { + /* Partial write. */ -- cgit v1.2.3