Bug 4309 - Vista disconnects request on a netbios keepalive on port 445
Summary: Vista disconnects request on a netbios keepalive on port 445
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 3.0.23d
Hardware: Other Windows NT
: P3 normal
Target Milestone: none
Assignee: Derrell Lipman
QA Contact: Samba QA Contact
Depends on:
Reported: 2006-12-24 06:33 UTC by Joakim Plate
Modified: 2007-09-16 09:55 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Plate 2006-12-24 06:33:50 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;
>     }
>     else
>     {
> 		struct sockaddr addr;
> 		int size = sizeof(addr);
> 		if (getpeername(server->cli.fd, &addr, &size))
> 			return 1;
>     }
> 	/* connection is ok */
> 	return 0;
> }
Comment 1 Björn Jacke 2006-12-27 05:57:48 UTC
this is also an issue with smbd and XP clients.
Comment 2 Derrell Lipman 2007-02-03 11:16:07 UTC
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.


Comment 3 Gerald (Jerry) Carter (dead mail address) 2007-03-23 07:59:36 UTC
Fix to be included in 3.0.25rc1
Comment 4 Gerald (Jerry) Carter (dead mail address) 2007-03-23 07:59:52 UTC
marking as fixed.