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

Christopher R. Hertel crh at ubiqx.mn.org
Thu Dec 28 00:30:03 GMT 2006


Joakim Plate wrote:
>  <derrell <at> samba.org> writes:
>> So I guess I have a couple of options: I could entirely remove the use of NBT
>> keepalive requests, or I can use them only if the port is 445.  Or, I can add
>> those nefarious tests to determine which protocol set is being used.
>>
> 
> I'd remove them, however after our first try, just ditching and checking 
> socket status by getpeername wasn't enough. XP servers silently drop the 
> connection after a timeout (hadn't set tcp keepalive thou).
> 
> I ended up working around it the way i mentioned in my other mail. By using 
> cli_echo if connection hasn't been used for a few seconds (10 in our case). If 
> the server drops the connection for some other reason other than timeout, it 
> can do it just as well during the actual command not during housekeeping, and 
> if we don't retry the command it won't be handled anyway. This way atleast the 
> silently dropped connections are caught. 

That makes the most sense to me.

Something to note about the SMB ECHO command: You don't have to be logged on
or even have to send a SMB NegProt to use the Echo.

Derrell:  In my earlier message I said something about sending an SMB
          message as a test to see if the server would handle naked
          transport.  I think I said SMB Session Setup.  I meant NegProt.
          Sorry.

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