diff options
author | Samba Release Account <samba-bugs@samba.org> | 1997-07-31 18:47:26 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1997-07-31 18:47:26 +0000 |
commit | 363b9a2739e9e39d1f69625e6647c6c9047a901a (patch) | |
tree | 1fb3f2f19bbcd15922468bf125ba1314220cd915 /source3/namedbsubnet.c | |
parent | f2b7e75f0cbff28b082150ba5ec60617b92bd545 (diff) | |
download | samba-363b9a2739e9e39d1f69625e6647c6c9047a901a.tar.gz samba-363b9a2739e9e39d1f69625e6647c6c9047a901a.tar.bz2 samba-363b9a2739e9e39d1f69625e6647c6c9047a901a.zip |
loadparm.c: Added new netbios aliases parameter (code from Cisco)
nameannounce.c: Code to announce aliases as well as our own names.
namedbsubnet.c: Code to add the aliases to the server list.
nameserv.c: Code to defend our aliases on the namelist.
namework.c: Code to check it's one of our aliases.
nmbd.c: Code to initialise the aliases.
proto.h: Fixup protos.
util.c: Code to check it's one of our aliases.
All above code based on code for 1.9.16p11 donated by Cisco
from Ben Woodard <bwoodard@luthien.cisco.com>
Jeremy (jallison@whistle.com)
(This used to be commit a2ce1c0cb1331551ff728dcfe3260fab4cd827e5)
Diffstat (limited to 'source3/namedbsubnet.c')
-rw-r--r-- | source3/namedbsubnet.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/source3/namedbsubnet.c b/source3/namedbsubnet.c index 5ddda0a282..6364ebba54 100644 --- a/source3/namedbsubnet.c +++ b/source3/namedbsubnet.c @@ -41,6 +41,7 @@ extern struct in_addr ipzero; extern pstring myname; extern fstring myworkgroup; +extern char **my_netbios_names; BOOL updatedlists = True; int updatecount = 0; @@ -214,13 +215,28 @@ void add_workgroup_to_subnet( struct subnet_record *d, char *group) */ if (strequal(myworkgroup, group)) { + int n; + add_my_name_entry(d,group,0x0 ,nb_type|NB_ACTIVE|NB_GROUP); add_my_name_entry(d,group,0x1e,nb_type|NB_ACTIVE|NB_GROUP); - /* add samba server name to workgroup list. */ - add_server_entry(d,w,myname,w->ServerType|SV_TYPE_LOCAL_LIST_ONLY,0, + + /* Add all our server names to the workgroup list. We remove any + browser or logon server flags from all but the primary name. + */ + for( n = 0; my_netbios_names[n]; n++) + { + char *name = my_netbios_names[n]; + int stype = w->ServerType; + + if(!strequal(myname, name)) + stype &= ~(SV_TYPE_MASTER_BROWSER|SV_TYPE_POTENTIAL_BROWSER| + SV_TYPE_DOMAIN_MASTER|SV_TYPE_DOMAIN_MEMBER); + + add_server_entry(d,w,name,stype|SV_TYPE_LOCAL_LIST_ONLY,0, lp_serverstring(),True); - DEBUG(3,("add_workgroup_to_subnet: Added server name entry %s to subnet %s\n", - myname, inet_ntoa(d->bcast_ip))); + DEBUG(3,("add_workgroup_to_subnet: Added server name entry %s \ +to subnet %s\n", name, inet_ntoa(d->bcast_ip))); + } } } |