summaryrefslogtreecommitdiff
path: root/source/namework.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-06-07 03:34:22 +0000
committerAndrew Tridgell <tridge@samba.org>1996-06-07 03:34:22 +0000
commit88b191b48836eeb7937f25b37d0bdd4a2276e5a7 (patch)
tree029183b29f3787bcbb34b61475bd02ad554d30e0 /source/namework.c
parent5a0d016b2432da9299d92b33d723534d91c8dcf4 (diff)
downloadsamba-88b191b48836eeb7937f25b37d0bdd4a2276e5a7.tar.gz
- added predict.c, moving the routines from util.c
- added iface_count() and iface_n_ip() routines so its easy to loop over the local interface list - made readsize a normal loadparm global - check for null w in add_domain_entry() - set the deathtime to time()-1 for doamin entries with servertype==0 This allows servers that are shutting down to be removed - add the 0x1c name at startup if we are a WINS server. Previously we added it only if we were a master - loop over interfaces in add_my_domains(), so people don't have to have a lmhosts file to get lp_workgroup() on all interfaces - set add to True for find_workgroupstruct() in nmbsync, and check for null return - remove some ugly "errno = EBADF" bits. they just confused things.
Diffstat (limited to 'source/namework.c')
-rw-r--r--source/namework.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/source/namework.c b/source/namework.c
index cbf65a955fc..5e61ecefb44 100644
--- a/source/namework.c
+++ b/source/namework.c
@@ -270,16 +270,19 @@ void update_from_reg(char *name, int type, struct in_addr ip)
/****************************************************************************
add the default workgroup into my domain
**************************************************************************/
-void add_my_domains(void)
+void add_my_domains(char *group)
{
- /* add or find domain on our local subnet, in the default workgroup */
-
- if (*lp_workgroup() != '*')
- {
- add_domain_entry(*iface_bcast(ipzero),
- *iface_nmask(ipzero),
- lp_workgroup(), True);
- }
+ int n,i;
+ struct in_addr *ip;
+
+ if (*group == '*') return;
+
+ n = iface_count();
+ for (i=0;i<n;i++) {
+ ip = iface_n_ip(i);
+ if (!ip) return;
+ add_domain_entry(*iface_bcast(*ip),*iface_nmask(*ip),lp_workgroup(),True);
+ }
}
@@ -728,7 +731,7 @@ static void process_reset_browser(struct packet_struct *p,char *buf)
struct work_record *work;
for (work=d->workgrouplist;work;work=remove_workgroup(d,work));
}
- add_my_domains();
+ add_my_domains(lp_workgroup());
}
/* stop browsing altogether. i don't think this is a good idea! */