summaryrefslogtreecommitdiff
path: root/source/nmbd
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
commit2c97b33fc0b5ef181dbf51a50cb61074935165bf (patch)
tree940f8da80d7ea3fe4941d7e03ebbfa4f69b82472 /source/nmbd
parent25560cf40b997e400d16fa0c1380e5bc29c015a5 (diff)
downloadsamba-2c97b33fc0b5ef181dbf51a50cb61074935165bf.tar.gz
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)
Diffstat (limited to 'source/nmbd')
-rw-r--r--source/nmbd/asyncdns.c32
-rw-r--r--source/nmbd/nmbd.c4
2 files changed, 18 insertions, 18 deletions
diff --git a/source/nmbd/asyncdns.c b/source/nmbd/asyncdns.c
index 548781edeab..94fd65b147a 100644
--- a/source/nmbd/asyncdns.c
+++ b/source/nmbd/asyncdns.c
@@ -35,22 +35,22 @@ extern int DEBUGLEVEL;
****************************************************************************/
static struct name_record *add_dns_result(struct nmb_name *question, struct in_addr addr)
{
- int name_type = question->name_type;
- char *qname = question->name;
-
- if (!addr.s_addr) {
- /* add the fail to WINS cache of names. give it 1 hour in the cache */
- DEBUG(3,("Negative DNS answer for %s\n", qname));
- add_netbios_entry(wins_subnet,qname,name_type,NB_ACTIVE,60*60,DNSFAIL,addr,
- True, True);
- return NULL;
- }
-
- /* add it to our WINS cache of names. give it 2 hours in the cache */
- DEBUG(3,("DNS gave answer for %s of %s\n", qname, inet_ntoa(addr)));
-
- return add_netbios_entry(wins_subnet,qname,name_type,NB_ACTIVE,2*60*60,DNS,addr,
- True,True);
+ int name_type = question->name_type;
+ char *qname = question->name;
+
+ if (!addr.s_addr) {
+ /* add the fail to WINS cache of names. give it 1 hour in the cache */
+ DEBUG(3,("Negative DNS answer for %s\n", qname));
+ add_netbios_entry(wins_client_subnet,qname,name_type,NB_ACTIVE,60*60,
+ DNSFAIL,addr,True);
+ return NULL;
+ }
+
+ /* add it to our WINS cache of names. give it 2 hours in the cache */
+ DEBUG(3,("DNS gave answer for %s of %s\n", qname, inet_ntoa(addr)));
+
+ return add_netbios_entry(wins_client_subnet,qname,name_type,NB_ACTIVE,
+ 2*60*60,DNS,addr, True);
}
diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c
index 5feeb07c90d..d53ec8c2e0c 100644
--- a/source/nmbd/nmbd.c
+++ b/source/nmbd/nmbd.c
@@ -283,8 +283,8 @@ static void load_hosts_file(char *fname)
ipaddr = *interpret_addr2(ip);
d = find_subnet_all(ipaddr);
if (d) {
- add_netbios_entry(d,name,0x00,NB_ACTIVE,0,source,ipaddr,True,True);
- add_netbios_entry(d,name,0x20,NB_ACTIVE,0,source,ipaddr,True,True);
+ add_netbios_entry(d,name,0x00,NB_ACTIVE,0,source,ipaddr,True);
+ add_netbios_entry(d,name,0x20,NB_ACTIVE,0,source,ipaddr,True);
}
}