LAN plugin problem - possible bug in NetBIOS name resolution

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
SlimShaggy
Junior Member
Junior Member
Posts: 6
Joined: 2013-07-12, 07:57 UTC

LAN plugin problem - possible bug in NetBIOS name resolution

Post by *SlimShaggy »

There seems to be a bug in the LAN plugin that sometimes prevents it from resolving the Windows host name. The plugin shows an "Unknown host" error after the "Getting directory" message when trying to connect. At the same time, if the IP address of the host is specified instead of NetBIOS name, the connection is successful. I looked up the network activity with Wireshark and found that the phone sends 2 NetBIOS name service queries (broadcast on port 137):
NB PC2<1d>
NB PC2<20>
querying for a host named PC2 which is a local master browser or a server respectively. These queries are never replied.
However, when I ping the PC2 from a Windows machine, I see the following query:
NB PC2<00>
which asks for a host named PC2 which is a Workstation/Redirector. This query is successfully replied by the PC2 workstation:
NB 192.168.17.109.
Therefore I think that if the LAN plugin sent the query with <00> (Workstation) service value, the connection would be successful.
The Windows host is running Windows 7 Ultimate.
I can email the Wireshark capture files if it will help.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48232
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks for the interesting info! I'm using the JCIFS library and didn't expect that it has such a bug. Do you know whether it's sufficient to send
NB PC2<00>
to get also the master browser and a server, or does it have to send all 3 queries?
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48232
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I have looked at this in detail now: When I try the connection from a Windows 8 PC, it also sends NB PCNAME<20> and not NB PCNAME<0>.

As I understand it, <20> means that the peer offers file server functions, but doesn't mean that it has to be a server. This is also described here:
http://support.microsoft.com/kb/163409/en
The NetBIOS suffix is used by Microsoft Networking software to identify functionality installed on the registered device.
00 Workstation Service
20 File Server Service
1D Master Browser

Here I found adescription of the Workstation Service - it has nothing to do with shared files:
http://technet.microsoft.com/en-us/library/cc939966.aspx

So to find a PC which offers shared files, <20> must be used, not <00>.
Author of Total Commander
https://www.ghisler.com
Post Reply