The Samba-Bugzilla – Bug 4309
Vista disconnects request on a netbios keepalive on port 445
Last modified: 2007-09-16 09:55:17 UTC
As per reqest on mailing list, here's a bugreport for the vista bug.
> If libsmbclient is connected to a vista server on port 445, only every
> second command will work. Before every command libsmbclient tries to
> verify that the server is valid by sending it a SMBkeepalive. However
> this is a netbios packet and can't be used on port 445 (smb over tcp).
> It seems previous windows version ignored this, vista however
> disconnects the client on such an invalid request.
> I changed the smbc_check_server to only do the keepalive when connected
> on port 139, sorry for this not being a patch, but I currently don't
> have any checked out version of samba. The alternative is to use
> cli_echo, but waiting for a roundtrip before trying to do anything
> seems overkill.
> The proper solution would be to do a retry on a failed request instead
> of the current way if checking connection prior to doing the actual
> request. But that is abit to much work for me.
> static int
> smbc_check_server(SMBCCTX * context,
> SMBCSRV * server)
> if (server->cli.port == 139)
> if ( send_keepalive(server->cli.fd) == False )
> return 1;
> struct sockaddr addr;
> int size = sizeof(addr);
> if (getpeername(server->cli.fd, &addr, &size))
> return 1;
> /* connection is ok */
> return 0;
this is also an issue with smbd and XP clients.
Should be fixed (for libsmbclient) by check-in 21132. I don't have an environment to test this, however. Please confirm that it is now working for you.
Fix to be included in 3.0.25rc1
marking as fixed.