svn commit: samba r21263 - in branches: SAMBA_3_0/source/lib SAMBA_3_0_25/source/lib

Volker Lendecke 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 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
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the samba-technical mailing list