Date: Thu, 8 Mar 2001 08:04:57 +0100 (CET) From: Blaz Zupan <blaz@amis.net> To: <hackers@freebsd.org> Subject: PATCH: workaround for FreeBSD 4.2-STABLE (fwd) Message-ID: <Pine.BSF.4.33.0103080804200.61740-100000@titanic.medinet.si>
next in thread | raw e-mail | index | archive | help
Anybody know which bug Wietse is talking about? Blaz Zupan, Medinet d.o.o, Linhartova 21, 2000 Maribor, Slovenia E-mail: blaz@amis.net, Tel: +386-2-320-6320, Fax: +386-2-320-6325 ---------- Forwarded message ---------- Date: Wed, 7 Mar 2001 10:49:52 -0500 (EST) From: Wietse Venema <wietse@porcupine.org> To: Postfix users <postfix-users@postfix.org> Subject: PATCH: workaround for FreeBSD 4.2-STABLE This is an UNTESTED workaround for an incompatible change in FreeBSD 4.2-STABLE that causes data to be lost when a client close()s a socket before the server has accept()ed the connection. This screws up the Postfix flush service, and may make some parts of Postfix fail randomly under a heavy system load. The UNTESTED workaround causes the client to wait until the server closes the connection first. This makes Postfix slower than necessary. The workaround is UNTESTED because I have no time to download and install FreeBSD 4.2-STABLE. To compile this UNTESTED workaround: [ apply patch ] % make makefiles CCARGS=-DBROKEN_FREEBSD_ACCEPT % make % su [ type your root password here ] # make install </dev/null Someone can tell the list if this UNTESTED workaround actually works. Wietse *** ./unix_trigger.c- Sun Mar 21 20:42:20 1999 --- ./unix_trigger.c Wed Mar 7 10:40:29 2001 *************** *** 79,84 **** --- 79,90 ---- if (msg_verbose) msg_warn("%s: write to %s: %m", myname, service); + #ifdef BROKEN_FREEBSD_ACCEPT + if (shutdown(fd, 1) < 0) + msg_fatal("shutdown: %m"); + read_wait(fd, -1); + #endif + /* * Disconnect. */ *** ./inet_trigger.c- Fri Dec 11 13:55:36 1998 --- ./inet_trigger.c Wed Mar 7 10:39:53 2001 *************** *** 81,86 **** --- 81,92 ---- if (msg_verbose) msg_warn("%s: write to %s: %m", myname, service); + #ifdef BROKEN_FREEBSD_ACCEPT + if (shutdown(fd, 1) < 0) + msg_fatal("shutdown: %m"); + read_wait(fd, -1); + #endif + /* * Disconnect. */ *** ./sane_accept.c- Sun Mar 21 20:25:52 1999 --- ./sane_accept.c Wed Mar 7 10:32:59 2001 *************** *** 53,58 **** --- 53,61 ---- ENETUNREACH, ENOTCONN, EWOULDBLOCK, + #ifdef BROKEN_FREEBSD_ACCEPT + ECONNABORTED, + #endif 0, }; int count; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.33.0103080804200.61740-100000>