[jcifs] no name with type 0x00 with no scope for host

Christopher R. Hertel crh at ubiqx.org
Thu Feb 21 15:38:22 EST 2002

"Allen, Michael B (RSCH)" wrote:
>         And we don't care because we know XP takes both an IP address and
>         *SMBSERVER as a called name.

Right.  We don't care if we are trying to connect to an SMB fileservice. 
But if we are trying to connect to an SMB fileservice than what the heck
does an UnknownHostException no 0x00 name mean?

>         For the benifit of exceptional users the API is "open ended" in
> that it allows you to
>         get down to the metal but there are no polished RFC 1002
> specific error messages
>         to teach you the NetBIOS protocol. You cannot use a DNS name
> with NbtAddress,
>         that's what the UniAddress class is for. And if you're getting
> down to the metal you
>         should know that the name lookup part may fail and be prepared
> to handle that.

I don't think I'm asking for RFC polish.  I just found that the error
message that was given was awkward in the context in which it appeared.

You're right, that if someone is "getting down to the metal" then they
really should know how this stuff works at that level.  I'm not thinking
about the down-to-the-metal crowd here (folks like you and me and many on
this list).  I'm thinking of someone just trying to use the library to build
an application.  If anything, telling them that the 0x00 name wasn't found
when they were just doing the equivalent of an 'nbtstat -A <IP>' is
providing too much information.

> There is no evidence that even suggests XP does not respond to <00> node
>         status.


What do you mean by a "<00> node status"?  If you send a NODE STATUS REQUEST
to an IP address, and use any name that the machine has registered, it will
respond just as it responds if you give it the wildcard name.

My point about XP is that, when I had access to a bunch of XP machines at
Connectathon, they did not register the <machine><00> name by default as
most of the other Windows flavors do.  That being the case, you are less
likely to get a response from an XP machine if you send a NAME QUERY REQUEST
to that machine using the <machine><00> name.  That's all.

>         What if there really isn't a 00 name? Saying "no status response
>         from host <ip>
>         was received" sounds like something went wrong.

Hang on.  If you send a query using the wildcard name and the remote host
doesn't have a <00> name you'll still get a response if the remote host is
running NBT.  Getting a response to a wildcard NODE STATUS REQUEST has
nothing to do with there being a <00> name there or not.

If you are doing a simple name lookup (you don't have the IP yet, only the
name) and the user does not supply the suffix value, then <00> is a good
guess.  (If the goal is to set up an SMB session then it might be better to
guess at the <20>, but that's neither here nor there.)  Anyway, if you are
doing a name lookup then it makes sense to report that a name could not be
found, and if you're guessing at the <00> suffix in order to do the name
lookup, then it's probably worth-while telling the user what you did.  I'm
not arguing against that.

>         User: "Status response? What's that? I'm just trying to do a
> reverse lookup on
>         FOO<00> and get all it's siblings like nbtstat -a does

...but the error comes up when the user is trying to do the equivalent of 
'nbtstat -A <IP>'.  I'm not arguing about what happens when they do a lookup
on "FOO".  (Note, though, that the user is probably doing a lookup on "FOO",
not "FOO<00>".)

> ... but what's a status
>         response? Does that mean the machine is down?!

It could, or it could mean that you're talking to an early W/95 box that
doesn't know how to answer a query properly.

Chris -)-----

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

More information about the jcifs mailing list