lkml.org 
[lkml]   [1998]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: Sendmail 8.9.0 claims a Linux kernel bug
From
Date
>>>>> "Andi" == Andi Kleen <ak@muc.de> writes:

(from the Sendmail KNOWN-BUGS file)

>> Apparently, the accept() in sendmail daemon loop can return
>> ETIMEDOUT and cause sendmail to sleep for 5 seconds during
>> which time no new connections will be accepted. An error is
>> reported to syslog:
>>
>> Jun 9 17:14:12 hostname sendmail[207]: NOQUEUE: SYSERR(root):
>> getrequests: accept: Connection timed out
>>
>> "Connection timed out" is not documented as a valid return from
>> accept(2) and this is believed to be a bug in the Linux kernel.

Andi> This is no kernel bug, but an intentional change from
Andi> BSD/Solaris semantics. Linux accept() returns errors for
Andi> failed connection attempts unlike BSD which drops them.

Ah hah!

Andi> It is a documentation bug if the manpage does not state
Andi> that.

Then let's document it. Who's the current maintainer of the kernel
manpages?

In any case, here's a preliminary patch to sendmail to fix this
problem for Linux. Is #ifdef __linux__ the right way to check if
we're compiling under Linux?

Are there any errors we should ignore besides ETIMEDOUT and
EHOSTUNREACH?

I'm forwarding this to the Sendmail people, as well.

Ben

diff -ruN sendmail-8.9.0.orig/src/daemon.c sendmail-8.9.0/src/daemon.c
--- sendmail-8.9.0.orig/src/daemon.c Tue May 19 16:36:06 1998
+++ sendmail-8.9.0/src/daemon.c Wed Jun 24 19:35:13 1998
@@ -293,7 +293,12 @@
lotherend = socksize;
t = accept(DaemonSocket,
(struct sockaddr *)&RealHostAddr, &lotherend);
+#ifdef __linux__
+ if (t >= 0 || (errno != EINTR && errno != ETIMEDOUT
+ && errno != EHOSTUNREACH))
+#else
if (t >= 0 || errno != EINTR)
+#endif
break;
}
savederrno = errno;
--
Brought to you by the letters A and K and the number 14.
"Everybody wants prosthetic foreheads on their real heads." -- TMBG
Debian GNU/Linux -- where do you want to go tomorrow? http://www.debian.org/
I'm on FurryMUCK as Che, and EFNet and YiffNet IRC as Che_Fox.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.169 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site