summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_subnetdb.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-06-27 00:27:44 +0000
committerJeremy Allison <jra@samba.org>1998-06-27 00:27:44 +0000
commitd8b0a8bab2334e9214975e3ac35c1556c4030fd9 (patch)
tree04815c3cc46e0d245b208ddf4e6d3d251c2a1f46 /source3/nmbd/nmbd_subnetdb.c
parentbc39cff279ef3df174c1d1408f90e88666e64237 (diff)
downloadsamba-d8b0a8bab2334e9214975e3ac35c1556c4030fd9.tar.gz
samba-d8b0a8bab2334e9214975e3ac35c1556c4030fd9.tar.bz2
samba-d8b0a8bab2334e9214975e3ac35c1556c4030fd9.zip
nisppass.c: Fixed incorrect parameter usage.
nmbd_become_lmb.c: Add 'force_new_election' parameter to some functions. This allows the start of the election to be done *after* the demotion from local master browser is done. Also changed code so release of 1d name is done immediately to allow other local master to gain it. nmbd_elections.c: Ensured no elections are run until we have registered the WORKGROUP<1e> name that we must listen on to participate in elections. nmbd_incomingdgrams.c: Use force_new_election code. nmbd_namelistdb.c: Make update_name_in_namelist static. nmbd_subnetdb.c: Fix bug in comparison function. We cannot use memcmp as structure packing may make this fail. nmbd_packets.c: Ensure that we only send one release packet when sending a broadcast packet. nmbd_workgroupdb.c: Ensure we put the correct value in the ElectionCriterion field. nmblib.c: Ensure make_nmb_name zero's the struct nmb_name. Jeremy. (This used to be commit 1fcb094ba04f01be1261ac92198c25b21b0d5ad5)
Diffstat (limited to 'source3/nmbd/nmbd_subnetdb.c')
-rw-r--r--source3/nmbd/nmbd_subnetdb.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c
index 2b29d1b45b..40ae1db1b3 100644
--- a/source3/nmbd/nmbd_subnetdb.c
+++ b/source3/nmbd/nmbd_subnetdb.c
@@ -75,12 +75,27 @@ static void add_subnet(struct subnet_record *subrec)
/* CRH!!! */
/* ************************************************************************** ** * This will go away when we move to a "real" database back-end.
+ Note that we cannot use memcmp here as we have no control
+ over how the struct nmb_name structures are packed in memory. JRA.
* ************************************************************************** ** */
int namelist_entry_compare( ubi_trItemPtr Item, ubi_trNodePtr Node )
{
struct name_record *NR = (struct name_record *)Node;
+ struct nmb_name *nmbname = (struct nmb_name *)Item;
+ int ret;
- return( memcmp( Item, &(NR->name), sizeof(struct nmb_name) ) );
+ if(nmb_name_equal( &NR->name, nmbname))
+ return 0;
+
+ ret = strcmp( nmbname->name, NR->name.name);
+ if(ret)
+ return ret;
+
+ ret = strcmp( nmbname->scope, NR->name.scope);
+ if(ret)
+ return ret;
+
+ return nmbname->name_type - NR->name.name_type;
} /* namelist_entry_compare */
/* CRH!!! */