[jcifs] Strange jetDirect printer behavior

Michael B Allen mba2000 at ioplex.com
Fri May 19 21:58:57 GMT 2006

On Fri, 19 May 2006 14:30:26 -0400
Mike Davidson <mike.davidson at raritan.com> wrote:

> Basically I changed the NameServiceClient.send() method such that it  
> requires the recordType field of incoming responses to match the  
> questionType field of the original request packet.  If the types do  
> NOT match the response packet is ignored  and the send() method  

Technically that's not correct protocol because if NetBIOS is supposed
to be anything like DNS (and the resource record structure is virtually
identical) then there may be any number of records that may be valid
answers or they may just be informational. It depends on if the records
are "answers" or "additional". The technically correct behavior would
be to parse the message and then determine through whatever logic that
the answswer should be ignored.

However, there are three reasons why we won't do that:
 1) it may unnecessarily complicate the code to process multiple responses
    for the same transaction ID
 2) in practice the range of responses in NetBIOS is very limited
 3) the JetDirect behavior is a special case so we'll need some goofey
    clause somewhere anyway

I think the solution is to just do what you say and short circuit the
bogus response since we obviously don't care about an NBSTAT if we didn't
ask for one.

I don't see why this is a 20 line code change though. We'll see.


More information about the jcifs mailing list