summaryrefslogtreecommitdiff
path: root/source3/nameelect.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-10-23 22:30:57 +0000
committerJeremy Allison <jra@samba.org>1997-10-23 22:30:57 +0000
commitabb255cfe674a39c6a42f5083af9c5facdbcca05 (patch)
treebccbf53d36ce62b7a0e23cbcf628a53850c2db95 /source3/nameelect.c
parent5557ab3c007b79c132e9a2da16e41be7b13f1b39 (diff)
downloadsamba-abb255cfe674a39c6a42f5083af9c5facdbcca05.tar.gz
samba-abb255cfe674a39c6a42f5083af9c5facdbcca05.tar.bz2
samba-abb255cfe674a39c6a42f5083af9c5facdbcca05.zip
Big change to make nmbd code more readable/understandable.
Main change is removal of find_name_search() confusion. This has been replaced with find_name_on_subnet() which makes it explicit what is being searched. Also changed wins_subnet to be wins_client_subnet in preparation for splitting the wins subnet into client and server pieces. This is a big nmbd change and I'd appreciate any bug reports. Specific changes follow : asyncdns.c: Removed wins entry from add_netbios_entry(). This is now explicit in the subnet_record parameter. interface.c: iface_bcast(), iface_nmask(), iface_ip() return the default interface if none can be found. Made this behavior explicit - some code in nmbd incorrectly depended upon this (reply_name_status() for instance). nameannounce.c: find_name_search changes to find_name_on_subnet. namebrowse.c: wins_subnet renamed to wins_client_subnet. namedbname.c: find_name_search removed. find_name_on_subnet added. add_netbios_entry - wins parameter removed. namedbsubnet.c: find_req_subnet removed - not explicit enough. nameelect.c: wins_subnet renamed to wins_client_subnet. namepacket.c: listening() simplified. nameresp.c: wins_subnet renamed to wins_client_subnet. nameserv.c: find_name_search moved to find_name_on_subnet. nameserv.h: FIND_XXX -> changed to FIND_SELF_NAME, FIND_ANY_NAME. nameservreply.c: find_name_search moved to find_name_on_subnet. Debug entries changed. nameservresp.c: wins_subnet renamed to wins_client_subnet. namework.c: wins_subnet renamed to wins_client_subnet. nmbd.c: wins parameter removed from add_netbios_entry. nmbsync: wins_subnet renamed to wins_client_subnet. proto.h: The usual. server.c: remove accepted fd from fd_set. Jeremy (jallison@whistle.com) (This used to be commit 2c97b33fc0b5ef181dbf51a50cb61074935165bf)
Diffstat (limited to 'source3/nameelect.c')
-rw-r--r--source3/nameelect.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source3/nameelect.c b/source3/nameelect.c
index 215ee94feb..391320e84f 100644
--- a/source3/nameelect.c
+++ b/source3/nameelect.c
@@ -207,7 +207,7 @@ void name_unregister_work(struct subnet_record *d, char *name, int name_type)
int remove_type_domain = 0;
int remove_type_logon = 0;
- remove_netbios_name(d,name,name_type,SELF,ipzero);
+ remove_netbios_name(d,name,name_type,SELF);
if (!(work = find_workgroupstruct(d, name, False))) return;
@@ -254,7 +254,8 @@ void name_register_work(struct subnet_record *d, char *name, int name_type,
struct work_record *work = find_workgroupstruct(d,
myworkgroup, False);
- add_netbios_entry(d,name,name_type,nb_flags,ttl,source,ip,True,!bcast);
+ struct subnet_record *add_subnet = (!bcast) ? wins_client_subnet : d;
+ add_netbios_entry(add_subnet,name,name_type,nb_flags,ttl,source,ip,True);
if (work)
{
@@ -488,7 +489,7 @@ void become_domain_master(struct subnet_record *d, struct work_record *work)
DEBUG(0,("Samba is now a domain master browser for workgroup %s on subnet %s\n",
work->work_group, inet_ntoa(d->bcast_ip)));
- if (d == wins_subnet)
+ if (d == wins_client_subnet)
{
/* ok! we successfully registered by unicast with the
WINS server. we now expect to become the domain
@@ -642,8 +643,8 @@ void unbecome_domain_master(struct subnet_record *d, struct work_record *work,
}
/* Unregister the 1b name from the WINS server. */
- if(wins_subnet != NULL)
- remove_name_entry(wins_subnet, myworkgroup, 0x1b);
+ if(wins_client_subnet != NULL)
+ remove_name_entry(wins_client_subnet, myworkgroup, 0x1b);
}
}