diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-08-30 06:49:14 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-08-30 06:49:14 +0000 |
commit | 3debe642bd299e1aed8578df342f4bfecf5d8b3b (patch) | |
tree | 9b0920bc7a3e3fe60b11855ac618e68ba010de13 /source3/nmbd | |
parent | 36ca3e3411cd3193c84a71c935881ceab3b61055 (diff) | |
download | samba-3debe642bd299e1aed8578df342f4bfecf5d8b3b.tar.gz samba-3debe642bd299e1aed8578df342f4bfecf5d8b3b.tar.bz2 samba-3debe642bd299e1aed8578df342f4bfecf5d8b3b.zip |
include our netbios names list and our workgroup in the wins.dat hash
(This used to be commit f555a76df696a0625acc16fa365dc048e0c2447d)
Diffstat (limited to 'source3/nmbd')
-rw-r--r-- | source3/nmbd/nmbd_winsserver.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c index 11e0aaecd6..e7c6d69cd6 100644 --- a/source3/nmbd/nmbd_winsserver.c +++ b/source3/nmbd/nmbd_winsserver.c @@ -29,6 +29,26 @@ extern int DEBUGLEVEL; extern struct in_addr ipzero; + + +/**************************************************************************** +hash our interfaces and netbios names settings +*****************************************************************************/ +static unsigned wins_hash(void) +{ + int i; + unsigned ret = iface_hash(); + extern char **my_netbios_names; + + for (i=0;my_netbios_names[i];i++) + ret ^= str_checksum(my_netbios_names[i]); + + ret ^= str_checksum(lp_workgroup()); + + return ret; +} + + /**************************************************************************** Determine if this packet should be allocated to the WINS server. *****************************************************************************/ @@ -174,7 +194,7 @@ BOOL initialise_wins(void) if (strncmp(line,"VERSION ", 8) == 0) { if (sscanf(line,"VERSION %d %u", &version, &hash) != 2 || version != WINS_VERSION || - hash != iface_hash()) { + hash != wins_hash()) { DEBUG(0,("Discarding invalid wins.dat file [%s]\n",line)); fclose(fp); return True; @@ -1576,7 +1596,7 @@ void wins_write_database(void) DEBUG(4,("wins_write_database: Dump of WINS name list.\n")); - fprintf(fp,"VERSION %d %u\n", WINS_VERSION, iface_hash()); + fprintf(fp,"VERSION %d %u\n", WINS_VERSION, wins_hash()); for( namerec = (struct name_record *)ubi_trFirst( wins_server_subnet->namelist ); |