libsmbclient: Vista servers disconnect on netbios keepalive message on port 445

Christopher R. Hertel crh at ubiqx.mn.org
Wed Dec 27 16:19:14 GMT 2006


Bjoern Jacke wrote:
> On Sun, Dec 24, 2006 at 02:47:46AM +0100, elupus wrote:
>> 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
> 
> this is also an issue with XP, maybe 2k, too. smbd sends keepalive smb
> packages to clients periodically causing the client to reset the
> connection and reconnect. Your approach to check for port 139 when
> sendinf smb keepalive packages looks reasonable. For smb via tcp no smb
> keepalive should be needed as tcp can take care for keep alive for
> itself.

The NBT session service is also carried via TCP.  The only real difference
between NBT sessions and naked transport sessions is that NBT requires the
NBT Session Request/Response and provides for the keepalive.

When I say "requires", I mean that it's in the NBT specifications.  Samba
(wisely) makes all of that stuff optional, so either set of semantics is
supported via both service ports.

It's a minor point, but I'll mention again that the port number alone may
not be enough to properly determine whether NBT or naked TCP transport is
being used.

Chris -)----

-- 
"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org


More information about the samba-technical mailing list