From c336a2f08183f63031b0a08b2111669bc36a5f30 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 17 Oct 1997 23:08:07 +0000 Subject: .cvsignore: Added make_smbcodepage interface.c: Added is_local_net(). locking.c: Added Fix for zero length share files from Gerald Werner plus a race condition fix for the fix. nameannounce.c: Made function static. namedbresp.c: extern int ClientDGRAM removed - not used. namedbserver.c: extern int ClientDGRAM removed - not used. namedbsubnet.c: Added code to make sockets per subnet. namepacket.c: Added code to read from all sockets & filter. nameresp.c: extern int ClientDGRAM removed - not used. nameserv.c: Indentation tidyup :-). nameserv.h: Added sockets to struct subnet. nameservresp.c: Improved debug message. nmbd.c: Changed to terminte on listen_for_packets exiting. nmbsync.c: extern int ClientDGRAM & ClientNMB removed - not used. proto.h: The usual. util.c: Fixed debug message. Jeremy (jallison@whistle.com) (This used to be commit 6904c2de080b2a9702800e9e4126386ced20569d) --- source3/nameserv.c | 70 ++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 36 deletions(-) (limited to 'source3/nameserv.c') diff --git a/source3/nameserv.c b/source3/nameserv.c index bc37d1c424..a90b41f834 100644 --- a/source3/nameserv.c +++ b/source3/nameserv.c @@ -168,7 +168,7 @@ void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags) } else { - /* broadcast the packet, but it comes from ipzero */ + /* broadcast the packet */ queue_netbios_packet(d,ClientNMB, re_reg ? NMB_REG_REFRESH : NMB_REG, NAME_REGISTER, name, type, nb_flags, GET_TTL(0),0,NULL,NULL, @@ -214,45 +214,43 @@ void add_domain_logon_names(void) ****************************************************************************/ void add_domain_master_bcast(void) { - struct subnet_record *d; - - if (!lp_domain_master()) return; - - for (d = FIRST_SUBNET; d; d = NEXT_SUBNET_EXCLUDING_WINS(d)) - { - struct work_record *work = find_workgroupstruct(d, myworkgroup, True); - - if (work && work->dom_state == DOMAIN_NONE) - { - struct nmb_name n; - make_nmb_name(&n,myworkgroup,0x1b,scope); + struct subnet_record *d; - if (!find_name(d->namelist, &n, FIND_SELF)) - { - DEBUG(0,("%s add_domain_names: attempting to become domain \ -master browser on workgroup %s %s\n", - timestring(), myworkgroup, inet_ntoa(d->bcast_ip))); + if (!lp_domain_master()) return; - /* send out a query to establish whether there's a - domain controller on the local subnet. if not, - we can become a domain controller. it's only - polite that we check, before claiming the - NetBIOS name 0x1b. - */ + for (d = FIRST_SUBNET; d; d = NEXT_SUBNET_EXCLUDING_WINS(d)) + { + struct work_record *work = find_workgroupstruct(d, myworkgroup, True); - DEBUG(0,("add_domain_names:querying subnet %s \ -for domain master on workgroup %s\n", - inet_ntoa(d->bcast_ip), myworkgroup)); + if (work && work->dom_state == DOMAIN_NONE) + { + struct nmb_name n; + make_nmb_name(&n,myworkgroup,0x1b,scope); - queue_netbios_packet(d,ClientNMB,NMB_QUERY, - NAME_QUERY_DOMAIN, - myworkgroup, 0x1b, - 0, 0,0,NULL,NULL, - True, False, - d->bcast_ip, d->bcast_ip, 0); - } - } - } + if (!find_name(d->namelist, &n, FIND_SELF)) + { + DEBUG(0,("%s add_domain_names: attempting to become domain \ +master browser on workgroup %s %s\n", timestring(), myworkgroup, inet_ntoa(d->bcast_ip))); + + /* send out a query to establish whether there's a + domain controller on the local subnet. if not, + we can become a domain controller. it's only + polite that we check, before claiming the + NetBIOS name 0x1b. + */ + + DEBUG(0,("add_domain_names:querying subnet %s \ +for domain master on workgroup %s\n", inet_ntoa(d->bcast_ip), myworkgroup)); + + queue_netbios_packet(d,ClientNMB,NMB_QUERY, + NAME_QUERY_DOMAIN, + myworkgroup, 0x1b, + 0, 0,0,NULL,NULL, + True, False, + d->bcast_ip, d->bcast_ip, 0); + } + } + } } -- cgit