[jcifs] JCIFS ignoring WINS properties and only performing broadcast requests

Abhinay Mehta abhinay at netusage.net
Thu Jul 12 10:25:57 GMT 2007


Michael B Allen wrote:
> On Wed, 11 Jul 2007 16:39:34 +0100
> Abhinay Mehta <abhinay at netusage.net> wrote:
> 
>> Hi all,
>>
>> This is my test code:
>>
>>
>>     public static void main(String[] args) {
>>        jcifs.Config.setProperty( "jcifs.netbios.wins", "192.168.1.8" );
>>        jcifs.Config.setProperty("jcifs.resolveOrder", "WINS,DNS" );
>>
>>        try {
>>           String hostName = 
>> UniAddress.getByName("192.168.1.10").getHostName();
>>           System.out.println("Host Name = " + hostName);
>>        } catch (UnknownHostException e) {
>>           e.printStackTrace();
>>        }
>>     }
>>
>>
>> I am doing TCP DUMP and am seeing that only broadcast requests are being 
>> sent, why so?
>>
>> I would very much appreciate it if someone could point me in the right 
>> direction.
>>
>> I was reading UniAddress' source code and noticed that in UniAddress' 
>> getByName method there's a method call to isDotQuadIP, and as far as I 
>> can see, that method forces all IP address requests to perform broadcast 
>> requests. Is that right?
> 
> If that's true it sounds like a bug. If BCAST isn't in jcifs.resolveOrder
> it should never do broadcast lookups AND if the hostname is an IP it
> shouldn't do any lookup at all. I'll add this to The List for checking.
> 
> Mike
> 

Sorry my mistake, now it is NOT sending broadcast requests, it is 
sending UNICAST requests, here's the line from TCPDUMP:

1:22:25.139293 IP 192.168.3.97.32901 > 192.168.1.10.netbios-ns: NBT UDP 
PACKET(137): QUERY; REQUEST; UNICAST

Why on earth would it try and do that?


More information about the jcifs mailing list