Anybody know which bug Wietse is talking about?

Blaz Zupan,  Medinet d.o.o, Linhartova 21, 2000 Maribor, Slovenia
E-mail: [EMAIL PROTECTED], 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 <[EMAIL PROTECTED]>
To: Postfix users <[EMAIL PROTECTED]>
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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to