summaryrefslogtreecommitdiffstats
path: root/source3/nameannounce.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-06-06 11:43:09 +0000
committerAndrew Tridgell <tridge@samba.org>1996-06-06 11:43:09 +0000
commitb9ae225b28f4707609e6436dad4be7ebdd7e181f (patch)
treede9b672d8fd9cbb0e79039f7ea543b4c4793a2d1 /source3/nameannounce.c
parentf57b053db8b17041ef02588127a67f362af871b6 (diff)
downloadsamba-b9ae225b28f4707609e6436dad4be7ebdd7e181f.tar.gz
samba-b9ae225b28f4707609e6436dad4be7ebdd7e181f.tar.xz
samba-b9ae225b28f4707609e6436dad4be7ebdd7e181f.zip
- added interface.c and removed all the references to myip, bcast_ip
and Netmask, instead replacing them with calls to routines in interface.c - got rid of old MAXINT define - added code to ensure we only return one entry for each name in the ipc enum routines - added new_only option to add_netbios_entry() to prevent overwriting of important names - minor time handling fixup (This used to be commit 7ed71b73ae745da099072eee36fc2700d1d91407)
Diffstat (limited to 'source3/nameannounce.c')
-rw-r--r--source3/nameannounce.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/source3/nameannounce.c b/source3/nameannounce.c
index 6b086c97746..197548088bb 100644
--- a/source3/nameannounce.c
+++ b/source3/nameannounce.c
@@ -33,9 +33,6 @@
extern int DEBUGLEVEL;
extern BOOL CanRecurse;
-extern struct in_addr myip;
-extern struct in_addr bcast_ip;
-extern struct in_addr Netmask;
extern struct in_addr ipzero;
extern pstring myname;
@@ -84,7 +81,7 @@ void announce_request(struct work_record *work, struct in_addr ip)
p = skip_string(p,1);
send_mailslot_reply(BROWSE_MAILSLOT,ClientDGRAM,outbuf,PTR_DIFF(p,outbuf),
- myname,work->work_group,0x20,0x0,ip,myip);
+ myname,work->work_group,0x20,0x1e,ip,*iface_ip(ip));
}
@@ -111,7 +108,7 @@ void do_announce_request(char *info, char *to_name, int announce_type,
p = skip_string(p,1);
send_mailslot_reply(BROWSE_MAILSLOT,ClientDGRAM,outbuf,PTR_DIFF(p,outbuf),
- myname,to_name,from,to,dest_ip,myip);
+ myname,to_name,from,to,dest_ip,*iface_ip(dest_ip));
}
/****************************************************************************
@@ -175,7 +172,8 @@ void announce_backup(void)
ClientDGRAM,outbuf,
PTR_DIFF(p,outbuf),
myname, work->work_group,
- 0x0,type,d->bcast_ip,myip);
+ 0x0,type,d->bcast_ip,
+ *iface_ip(d->bcast_ip));
}
}
}
@@ -205,7 +203,7 @@ void announce_host(void)
{
struct work_record *work;
- if (!ip_equal(bcast_ip,d->bcast_ip))
+ if (!ismybcast(d->bcast_ip))
continue;
for (work = d->workgrouplist; work; work = work->next)
@@ -231,7 +229,7 @@ void announce_host(void)
work->lastannounce_time = t;
- if (!ip_equal(bcast_ip,d->bcast_ip)) {
+ if (!ismybcast(d->bcast_ip)) {
stype &= ~(SV_TYPE_POTENTIAL_BROWSER | SV_TYPE_MASTER_BROWSER |
SV_TYPE_DOMAIN_MASTER | SV_TYPE_BACKUP_BROWSER |
SV_TYPE_DOMAIN_CTRL | SV_TYPE_DOMAIN_MEMBER);
@@ -266,7 +264,7 @@ void announce_host(void)
p = p+31;
p = skip_string(p,1);
- if (ip_equal(bcast_ip,d->bcast_ip))
+ if (ismybcast(d->bcast_ip))
{
if (AM_MASTER(work))
{
@@ -280,7 +278,8 @@ void announce_host(void)
send_mailslot_reply(BROWSE_MAILSLOT,ClientDGRAM,outbuf,
PTR_DIFF(p,outbuf),
my_name,work->work_group,0,
- 0x1e,d->bcast_ip,myip);
+ 0x1e,d->bcast_ip,
+ *iface_ip(d->bcast_ip));
DEBUG(2,("sending domain announce to %s for %s\n",
inet_ntoa(d->bcast_ip),work->work_group));
@@ -297,7 +296,8 @@ void announce_host(void)
send_mailslot_reply(BROWSE_MAILSLOT,ClientDGRAM,outbuf,
PTR_DIFF(p,outbuf),
- my_name,MSBROWSE,0,0x01,d->bcast_ip,myip);
+ my_name,MSBROWSE,0,0x01,d->bcast_ip,
+ *iface_ip(d->bcast_ip));
}
else
{
@@ -309,7 +309,7 @@ void announce_host(void)
send_mailslot_reply(BROWSE_MAILSLOT,ClientDGRAM,outbuf,
PTR_DIFF(p,outbuf),
my_name,work->work_group,0,0x1d,
- d->bcast_ip,myip);
+ d->bcast_ip,*iface_ip(d->bcast_ip));
}
}
}
@@ -424,11 +424,10 @@ void announce_master(void)
ip = *interpret_addr2(lp_domain_controller());
- if (zero_ip(ip))
- {
- ip = bcast_ip;
- bcast = True;
- }
+ if (zero_ip(ip)) {
+ ip = *iface_bcast(d->bcast_ip);
+ bcast = True;
+ }
DEBUG(2, ("Searching for PDC %s at %s\n",
lp_domain_controller(), inet_ntoa(ip)));