NetBIOS keepalive causing Windows to reset connection on NetBIOS connection on port 139

Derrell Lipman derrell.lipman at unwireduniverse.com
Fri Aug 31 20:07:49 GMT 2007


libsmbclient periodically checks whether a cached connection is still
alive.  Traditionally, it did this using a NetBIOS keepalive request.
Fairly recently, I made changes because a NetBIOS keepalive is
inappropriate when using naked transport (typically over port 445).
The test we used (as inaccurate as it is) was to use a keepalive
request if the connection was using port 139, and a getpeername() call
otherwise.

Today, I encountered a NAS device that resets a connection upon
receiving a NetBIOS keepalive request even though the request is
issued on port 139 and after it previously responded to a NBSS Session
Request with a NBSS Positive Session Response.  Sigh.

The NAS device identifies itself as: Microsoft(R) Windows(R) Server
2003 Standard x64 Edition Version 5.2.3790 Service Pack 1 Build 3790,
R2.  This problem does not exhibit itself on the w2k3 servers I've
tested against in the past.

I am looking for any reason why the NetBIOS keepalive request should
not be stripped entirely out of this code, and replaced with
getpeername() in all cases.  Can anyone explain why this would not be
an appropriate change in libsmbclient?

Thanks!

Derrell


More information about the samba-technical mailing list