mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
removed the remote interfaces stuff.
This commit is contained in:
parent
9e411f2c90
commit
51e5a1a546
@ -251,8 +251,6 @@ struct subnet_record
|
||||
struct in_addr bcast_ip;
|
||||
struct in_addr mask_ip;
|
||||
struct in_addr myip;
|
||||
|
||||
BOOL my_interface;
|
||||
};
|
||||
|
||||
/* a resource record */
|
||||
|
@ -142,7 +142,6 @@ char *lp_character_set(void);
|
||||
char *lp_logon_script(void);
|
||||
char *lp_wins_server(void);
|
||||
char *lp_interfaces(void);
|
||||
char *lp_remote_interfaces(void);
|
||||
BOOL lp_wins_support(void);
|
||||
BOOL lp_wins_proxy(void);
|
||||
BOOL lp_domain_master(void);
|
||||
|
@ -33,7 +33,6 @@ static BOOL got_bcast=False;
|
||||
static BOOL got_nmask=False;
|
||||
|
||||
struct interface *local_interfaces = NULL;
|
||||
struct interface *remote_interfaces = NULL;
|
||||
|
||||
struct interface *last_iface;
|
||||
|
||||
@ -349,12 +348,7 @@ load the remote and local interfaces
|
||||
void load_interfaces(void)
|
||||
{
|
||||
/* add the machine's interfaces to local interface structure*/
|
||||
interpret_interfaces(lp_interfaces (), &local_interfaces,
|
||||
"interface");
|
||||
|
||||
/* add all subnets to remote interfaces structure */
|
||||
interpret_interfaces(lp_remote_interfaces(), &remote_interfaces,
|
||||
"remote subnet");
|
||||
interpret_interfaces(lp_interfaces(), &local_interfaces,"interface");
|
||||
}
|
||||
|
||||
|
||||
|
@ -394,11 +394,13 @@ void announce_host(void)
|
||||
|
||||
work->lastannounce_time = t;
|
||||
|
||||
/*
|
||||
if (!d->my_interface) {
|
||||
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);
|
||||
}
|
||||
*/
|
||||
|
||||
for (s = work->serverlist; s; s = s->next) {
|
||||
if (strequal(myname, s->serv.name)) {
|
||||
|
@ -161,7 +161,7 @@ struct server_record *add_server_entry(struct subnet_record *d,
|
||||
}
|
||||
|
||||
|
||||
if (d->my_interface && strequal(lp_workgroup(),work->work_group))
|
||||
if (strequal(lp_workgroup(),work->work_group))
|
||||
{
|
||||
if (servertype)
|
||||
servertype |= SV_TYPE_LOCAL_LIST_ONLY;
|
||||
|
@ -47,9 +47,6 @@ int updatecount = 0;
|
||||
/* local interfaces structure */
|
||||
extern struct interface *local_interfaces;
|
||||
|
||||
/* remote interfaces structure */
|
||||
extern struct interface *remote_interfaces;
|
||||
|
||||
/* this is our domain/workgroup/server database */
|
||||
struct subnet_record *subnetlist = NULL;
|
||||
|
||||
@ -143,7 +140,6 @@ static struct subnet_record *make_subnet(struct in_addr bcast_ip, struct in_addr
|
||||
d->bcast_ip = bcast_ip;
|
||||
d->mask_ip = mask_ip;
|
||||
d->workgrouplist = NULL;
|
||||
d->my_interface = False; /* True iff the interface is on the samba host */
|
||||
|
||||
add_subnet(d);
|
||||
|
||||
@ -152,7 +148,7 @@ static struct subnet_record *make_subnet(struct in_addr bcast_ip, struct in_addr
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
add the remote interfaces from lp_remote_interfaces() and lp_interfaces()
|
||||
add the remote interfaces from lp_interfaces()
|
||||
to the netbios subnet database.
|
||||
****************************************************************************/
|
||||
void add_subnet_interfaces(void)
|
||||
@ -165,22 +161,7 @@ void add_subnet_interfaces(void)
|
||||
/* add the interface into our subnet database */
|
||||
if (!find_subnet(i->bcast))
|
||||
{
|
||||
struct subnet_record *d = make_subnet(i->bcast,i->nmask);
|
||||
if (d)
|
||||
{
|
||||
/* short-cut method to identifying local interfaces */
|
||||
d->my_interface = True;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* loop on all remote interfaces */
|
||||
for (i = remote_interfaces; i; i = i->next)
|
||||
{
|
||||
/* add the interface into our subnet database */
|
||||
if (!find_subnet(i->bcast))
|
||||
{
|
||||
make_subnet(i->bcast,i->nmask);
|
||||
make_subnet(i->bcast,i->nmask);
|
||||
}
|
||||
}
|
||||
|
||||
@ -248,15 +229,14 @@ struct subnet_record *add_subnet_entry(struct in_addr bcast_ip,
|
||||
|
||||
/* add WORKGROUP(1e) and WORKGROUP(00) entries into name database
|
||||
or register with WINS server, if it's our workgroup */
|
||||
if (strequal(lp_workgroup(), name) && d->my_interface)
|
||||
if (strequal(lp_workgroup(), name))
|
||||
{
|
||||
add_my_name_entry(d,name,0x1e,NB_ACTIVE|NB_GROUP);
|
||||
add_my_name_entry(d,name,0x0 ,NB_ACTIVE|NB_GROUP);
|
||||
}
|
||||
/* add samba server name to workgroup list. don't add
|
||||
lmhosts server entries to local interfaces */
|
||||
if ((strequal(lp_workgroup(), name) && d->my_interface) ||
|
||||
(lmhosts && !d->my_interface))
|
||||
if (strequal(lp_workgroup(), name))
|
||||
{
|
||||
add_server_entry(d,w,myname,w->ServerType,0,ServerComment,True);
|
||||
DEBUG(3,("Added server name entry %s at %s\n",
|
||||
|
@ -203,17 +203,12 @@ struct work_record *find_workgroupstruct(struct subnet_record *d,
|
||||
if ((work = make_workgroup(name)))
|
||||
{
|
||||
if (lp_preferred_master() &&
|
||||
strequal(lp_workgroup(), name) &&
|
||||
d->my_interface)
|
||||
strequal(lp_workgroup(), name))
|
||||
{
|
||||
DEBUG(3, ("preferred master startup for %s\n", work->work_group));
|
||||
work->needelection = True;
|
||||
work->ElectionCriterion |= (1<<3);
|
||||
}
|
||||
if (!d->my_interface)
|
||||
{
|
||||
work->needelection = False;
|
||||
}
|
||||
add_workgroup(work, d);
|
||||
return(work);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ void browser_gone(char *work_name, struct in_addr ip)
|
||||
/* i don't know about this workgroup, therefore i don't care */
|
||||
if (!work || !d) return;
|
||||
|
||||
if (strequal(work->work_group, lp_workgroup()) && d->my_interface)
|
||||
if (strequal(work->work_group, lp_workgroup()))
|
||||
{
|
||||
|
||||
DEBUG(2,("Forcing election on %s %s\n",
|
||||
@ -112,16 +112,12 @@ void browser_gone(char *work_name, struct in_addr ip)
|
||||
else
|
||||
{
|
||||
/* local interfaces: force an election */
|
||||
if (d->my_interface)
|
||||
send_election(d, work->work_group, 0, 0, myname);
|
||||
send_election(d, work->work_group, 0, 0, myname);
|
||||
|
||||
/* only removes workgroup completely on a local interface or
|
||||
if there are no server entries on the remote interface.
|
||||
(persistent lmhost entries on a remote interface will stop
|
||||
the workgroup being removed. persistent lmhosts entries on
|
||||
a local interface _will_ be removed).
|
||||
/* only removes workgroup completely on a local interface
|
||||
persistent lmhosts entries on a local interface _will_ be removed).
|
||||
*/
|
||||
remove_workgroup(d, work, d->my_interface);
|
||||
remove_workgroup(d, work,True);
|
||||
}
|
||||
}
|
||||
|
||||
@ -300,7 +296,7 @@ void become_master(struct subnet_record *d, struct work_record *work)
|
||||
work->ServerType |= SV_TYPE_MASTER_BROWSER;
|
||||
add_server_entry(d,work,myname,work->ServerType,0,ServerComment,True);
|
||||
|
||||
if (d->my_interface && work->serverlist == NULL) /* no servers! */
|
||||
if (work->serverlist == NULL) /* no servers! */
|
||||
{
|
||||
/* ask all servers on our local net to announce to us */
|
||||
announce_request(work, d->bcast_ip);
|
||||
@ -568,8 +564,7 @@ void process_election(struct packet_struct *p,char *buf)
|
||||
for (work = d->workgrouplist; work; work = work->next)
|
||||
{
|
||||
if (listening_name(work, &dgram->dest_name) &&
|
||||
strequal(work->work_group, lp_workgroup()) &&
|
||||
d->my_interface)
|
||||
strequal(work->work_group, lp_workgroup()))
|
||||
{
|
||||
if (win_election(work, version,criterion,timeup,name))
|
||||
{
|
||||
|
@ -186,8 +186,6 @@ void add_my_names(void)
|
||||
{
|
||||
BOOL wins_iface = ip_equal(d->bcast_ip, ipgrp);
|
||||
|
||||
if (!d->my_interface && !wins_iface) continue;
|
||||
|
||||
add_my_name_entry(d, myname,0x20,NB_ACTIVE);
|
||||
add_my_name_entry(d, myname,0x03,NB_ACTIVE);
|
||||
add_my_name_entry(d, myname,0x00,NB_ACTIVE);
|
||||
|
@ -656,8 +656,6 @@ static void process_announce_request(struct packet_struct *p,char *buf)
|
||||
|
||||
if (!d) return;
|
||||
|
||||
if (!d->my_interface) return;
|
||||
|
||||
for (work = d->workgrouplist; work; work = work->next)
|
||||
{
|
||||
/* XXXX BUG: the destination name type should also be checked,
|
||||
|
@ -112,10 +112,7 @@ static BOOL add_info(struct subnet_record *d, struct work_record *work, int serv
|
||||
/* creates workgroup on remote subnet */
|
||||
if ((w = find_workgroupstruct(d,sname,True)))
|
||||
{
|
||||
if (d->my_interface)
|
||||
{
|
||||
announce_request(w, d->bcast_ip);
|
||||
}
|
||||
announce_request(w, d->bcast_ip);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,6 @@ typedef struct
|
||||
char *szSmbrun;
|
||||
char *szWINSserver;
|
||||
char *szInterfaces;
|
||||
char *szRemoteInterfaces;
|
||||
int max_log_size;
|
||||
int mangled_stack;
|
||||
int max_xmit;
|
||||
@ -367,7 +366,6 @@ struct parm_struct
|
||||
{"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL},
|
||||
{"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL},
|
||||
{"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL},
|
||||
{"remote interfaces",P_STRING, P_GLOBAL, &Globals.szRemoteInterfaces,NULL},
|
||||
{"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL},
|
||||
{"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL},
|
||||
{"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL},
|
||||
@ -706,7 +704,6 @@ FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet)
|
||||
FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript)
|
||||
FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver)
|
||||
FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces)
|
||||
FN_GLOBAL_STRING(lp_remote_interfaces,&Globals.szRemoteInterfaces)
|
||||
|
||||
FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport)
|
||||
FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy)
|
||||
|
Loading…
Reference in New Issue
Block a user