Date: Mon, 22 Nov 2004 08:55:48 +0500 From: Boris Kovalenko <boris@ntmk.ru> To: freebsd-ports-bugs@freebsd.org Subject: [PATCH] Quagga's bgpd lockups when peer dies. Message-ID: <41A16344.30508@ntmk.ru>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------020703090606090108010302 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Hello! 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. With respect, Boris Kovalenko --------------020703090606090108010302 Content-Type: text/plain; name="Makefile.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Makefile.diff" --- Makefile.orig Mon Oct 18 08:32:51 2004 +++ Makefile Wed Nov 17 09:50:50 2004 @@ -7,7 +7,7 @@ PORTNAME= quagga PORTVERSION= 0.96.5 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= net ipv6 MASTER_SITES= http://quagga.net/download/ @@ -89,8 +89,6 @@ RC_DIR= ${PREFIX}/etc/rc.d RC_SUFX= .sh .endif - -QUAGGA_SCRIPTS= zebra ripd ripngd ospfd ospf6d bgpd SED_SCRIPT= -e 's,%%PREFIX%%,${PREFIX},g' \ -e 's,%%SYSCONF_DIR%%,${SYSCONF_DIR},g' \ --------------020703090606090108010302 Content-Type: text/plain; name="patch-bgp_packet.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-bgp_packet.c" --- bgpd/bgp_packet.c.orig Mon Nov 15 16:12:14 2004 +++ bgpd/bgp_packet.c Mon Nov 15 16:14:21 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. */ --------------020703090606090108010302--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41A16344.30508>