svn commit: samba r21263 - in branches: SAMBA_3_0/source/lib
Volker.Lendecke at SerNet.DE
Fri Feb 9 21:20:56 GMT 2007
On Fri, Feb 09, 2007 at 04:08:14PM -0500, derrell at samba.org wrote:
> Volker, I don't see anything in this changeset that references getpeername().
> I actually just put a getpeername() call into libsmbclient (see bug 4309) to
> detect loss of connection when we can't use SMBkeepalive packets because
> netbios isn't in use. Looking at the man page, it looks like a return of -1
> isn't quite adequate. We should also be checking for errno==ENOTCONN (which
> I'm not currently doing in the recent libsmbclient changes). Does that seem
> to you like a reasonably reliable indication of a TCP connection being dead?
Look at another_ldap_try(), there we call getpeername() to
decide whether this connection is dead.
I did the following test: Connect to smbd (ldapsam) with
rpcclient, restart the ldap server, the conn is in
CLOSE_WAIT, issue a "querydominfo" in rpcclient to make smbd
issue an ldap call.
strace on that smbd showed that getpeername() on the
connection in CLOSE_WAIT returned 0 (no error). Bad.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20070209/64c495d6/attachment.bin
More information about the samba-technical