Nbtstat vs. nmblookup & MAC addresses
Richard Sharpe
rsharpe at richardsharpe.com
Fri Apr 16 01:19:39 GMT 2004
On Thu, 15 Apr 2004, Phillip Ames wrote:
> Both responses are identical (I have ethereal captures of both). Ethereal
> interpets the MAC as 'Unit ID' and its position in the packet is after the
> last 'Name Flags' information (0xa400, P-node, group, active). This leads
> me to think the MAC is not returned as one of the flags.
OK, I can see that. It also seems like Samba does not fill in the Unit ID
field, so it is displayed as 00-00-00-00-00-00 on Windows.
> Nmblookup seems to get its information from "struct node_status
> *node_status_query(int fd,struct nmb_name *name, struct in_addr to_ip, int
> *num_names)" in libsmb/namequery.c.
OK, it looks lile node_status_query is simply not returning enough info,
and might not be parsing enough of the response packet, either.
> However, "free_packet(p2);" is called just before node_status is returned to
> the call in nmblookup where p2 is the packet received from the other
> machine. Am I correct in assuming that this effectively discards the MAC
> address I want before the nmblookup code has a chance to get at it?
Most likely, however, the correct way to deal with it is probably to
extend node_status_query to pass in a pointer to a structure that will
contain the additional information.
Regards
-----
Richard Sharpe, rsharpe[at]richardsharpe.com, rsharpe[at]samba.org,
sharpe[at]ethereal.com, http://www.richardsharpe.com
More information about the samba-technical
mailing list