From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Nov 22 03:55:52 2004 Return-Path: Delivered-To: freebsd-ports-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 582EB16A4CE for ; Mon, 22 Nov 2004 03:55:52 +0000 (GMT) Received: from mail.ntmk.ru (mail.ntmk.ru [217.114.241.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E7E443D5D for ; Mon, 22 Nov 2004 03:55:51 +0000 (GMT) (envelope-from boris@ntmk.ru) Received: from boris.nikom.ru ([10.1.16.195]) by mail.ntmk.ru with esmtp (Exim 4.34) id 1CW5Iq-00057U-MW for freebsd-ports-bugs@freebsd.org; Mon, 22 Nov 2004 08:55:48 +0500 Message-ID: <41A16344.30508@ntmk.ru> Date: Mon, 22 Nov 2004 08:55:48 +0500 From: Boris Kovalenko User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.3) Gecko/20041110 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: freebsd-ports-bugs@freebsd.org Content-Type: multipart/mixed; boundary="------------020703090606090108010302" Subject: [PATCH] Quagga's bgpd lockups when peer dies. X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2004 03:55:52 -0000 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--