diff options
author | Samba Release Account <samba-bugs@samba.org> | 1996-08-01 17:49:40 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1996-08-01 17:49:40 +0000 |
commit | 6e932e4bae8b46e7ff4a55a75484bad78308336a (patch) | |
tree | 2940fe8eeddf2d177c03650baa63b4a58bc576a4 /source/utils/nmblookup.c | |
parent | 801fe1066e7bae8b49e7396b04efe1d7135bbb05 (diff) | |
download | samba-6e932e4bae8b46e7ff4a55a75484bad78308336a.tar.gz samba-6e932e4bae8b46e7ff4a55a75484bad78308336a.tar.xz samba-6e932e4bae8b46e7ff4a55a75484bad78308336a.zip |
local_only NetServerEnum syncs can now be issued.
bug spotted in nameservresp.c - arguments to test subnet the response
is received on (same_net()) were the wrong way round (ccm@shentel.net)
samba was adding WORKGROUP(1e) as a unique not a group name: fixed this
bug in reply_name_status() and reply_name_query(): WINS entries weren't
being looked up.
name status reply adds local SELF entries to WINS SELF entries: some
SELF entries are only added locally, while others are only added via
WINS. name status needs to have both, combined.
a sync will only occur when an ANN_LocalMasterAnnouncement is received, NOT
an ANN_HostAnnouncement or an ANN_DomainAnnouncement.
when samba is a member of a workgroup, it looks for (using a wins server)
and announces to its domain master. NAME_QUERY_ANNOUNCE_HOST - yet another
'state' - has been created to do this: do the name query on the wins server
and send the announce host to the answer to this query.
jeremy @ vantive wrote the original code to do this, which used the
name_query() function. i'm trying to avoid name_query: it times out and
generally messes things up, but using queue_netbios_packet() and
queue_netbios_pkt_wins() is... not intuitive?
lkcl with help from jra
Diffstat (limited to 'source/utils/nmblookup.c')
-rw-r--r-- | source/utils/nmblookup.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source/utils/nmblookup.c b/source/utils/nmblookup.c index a543b90762f..292b526df93 100644 --- a/source/utils/nmblookup.c +++ b/source/utils/nmblookup.c @@ -49,7 +49,7 @@ static BOOL open_sockets(void) return False; } - ServerFD = open_socket_in(SOCK_DGRAM, NMB_PORT,3); + ServerFD = open_socket_in(SOCK_DGRAM, 0,3); if (ServerFD == -1) return(False); @@ -151,7 +151,7 @@ int main(int argc,char *argv[]) for (i=optind;i<argc;i++) - { + { BOOL bcast = True; int retries = 2; char *p; @@ -177,20 +177,18 @@ int main(int argc,char *argv[]) retries = 1; } - if (name_query(ServerFD,lookup,lookup_type,bcast,True, + if (name_query(ServerFD,lookup,lookup_type,bcast,True, *iface_bcast(ipzero),&ip,NULL)) { printf("%s %s\n",inet_ntoa(ip),lookup); - if (find_status) - { + } + if (find_status) + { printf("Looking up status of %s\n",inet_ntoa(ip)); name_status(ServerFD,lookup,lookup_type,True,ip,NULL,NULL,NULL); printf("\n"); - } - } else { - printf("couldn't find name %s\n",lookup); - } - } + } + } return(0); } |