|
Description
|
Full problem description: The accept(3SOCKET) syscall may return with non-zero integer value without setting the addrlen argument (actually clearing it to zero) and the socket address. This has been observed for SCTP sockets.
For example:
Message from syslogd@clf64_d3 at Tue Mar 6 13:54:04 2007 ...
clf64_d3 clfd_lmcropa[5364]: [ID 702911 local6.emerg] <GPH> (271) gphsock.c:1957 [***EMERG] Unexpected/unsupported address family=65535 returned by accept (kernel bug?) (proto=132 fd=41 addrlen requested=16 returned=0 sockaddr_in=16)
This message is logged by a function calling accept that looks like this (where UTL_Sockaddr_t is a union that can contain sockaddr_in/sockaddr_in6):
socklen_t addrlen = srvSock->base.addrlen;
UTL_Sockaddr_t remoteAddr;
int fd=99;
remoteAddr.u.addr.sa_family=-1;
if ( (fd = accept(srvSock->base.fd,&remoteAddr.u.addr,&addrlen)) < 0 ){
SOCK_SYSCALL_ERR(srvSock,"Accept failed%s","");
++srvSock->stats.nbInboundConnErrors;
return;
}
/* Make sure the kernel return something expected */
if ( remoteAddr.u.addr.sa_family != AF_INET ){
UTL_LOG(UTL_LOG_EMERG,gph_CompId,
"Unexpected/unsupported address family=%d returned by accept (kernel bug?) (proto=%d fd=%d addrlen requested=%d returned=%d sockaddr_in=%zu)",
remoteAddr.u.addr.sa_family,
srvSock->base.gph->protoNumber,
fd,
srvSock->base.addrlen, addrlen,
sizeof(struct sockaddr_in));
close(fd);
++srvSock->stats.nbInboundConnErrors;
return;
}
This is an intermittent problem that occurs once and a while and it seems that the next connection attempts may be correctly accepted.
|