diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-07-24 10:24:27 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:28:57 -0500 |
commit | 4ce5c3636714e80f740c141587c1e7a9ca3b67bb (patch) | |
tree | 67f38ef59f6427ac44ddb78bb7d609576d962d79 /source3/nmbd | |
parent | 12324f017c06e95013b4a6130df9cfa5e270ac0d (diff) | |
download | samba-4ce5c3636714e80f740c141587c1e7a9ca3b67bb.tar.gz samba-4ce5c3636714e80f740c141587c1e7a9ca3b67bb.tar.bz2 samba-4ce5c3636714e80f740c141587c1e7a9ca3b67bb.zip |
r24027: merge from http://people.samba.org/bzr/metze/samba/3_2-ctdb-metze/:
add in any cluster addresses. We need to response to these,
but not listen on them. This allows us to run nmbd on every
node in the cluster, and have all of them register with a
WINS server correctly
metze
(This used to be commit 98c57562c4dcf04b72a1e4ad5d9f5cf48e7d0b28)
Diffstat (limited to 'source3/nmbd')
-rw-r--r-- | source3/nmbd/nmbd_mynames.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source3/nmbd/nmbd_mynames.c b/source3/nmbd/nmbd_mynames.c index 5ebd42ce87..8fa5439ee3 100644 --- a/source3/nmbd/nmbd_mynames.c +++ b/source3/nmbd/nmbd_mynames.c @@ -114,6 +114,7 @@ BOOL register_my_workgroup_and_names(void) { struct subnet_record *subrec; int i; + const char **cluster_addresses = NULL; for(subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_INCLUDING_UNICAST(subrec)) { register_my_workgroup_one_subnet(subrec); @@ -145,6 +146,35 @@ BOOL register_my_workgroup_and_names(void) } /* + * add in any cluster addresses. We need to response to these, + * but not listen on them. This allows us to run nmbd on every + * node in the cluster, and have all of them register with a + * WINS server correctly + */ + if (lp_clustering()) { + cluster_addresses = lp_cluster_addresses(); + } + if (cluster_addresses) { + int a, n; + unsigned name_types[] = {0x20, 0x3, 0x0}; + + for (i=0; my_netbios_names(i); i++) { + for(subrec = FIRST_SUBNET; subrec; subrec = subrec->next) { + for (n=0;n<ARRAY_SIZE(name_types);n++) { + struct name_record *namerec; + struct nmb_name nmbname; + make_nmb_name(&nmbname, my_netbios_names(i), name_types[n]); + namerec = find_name_on_subnet(unicast_subnet, &nmbname, FIND_SELF_NAME); + if (namerec == NULL) continue; + for (a=0;cluster_addresses[a];a++) { + add_ip_to_name_record(namerec, *interpret_addr2(cluster_addresses[a])); + } + } + } + } + } + + /* * Add the WORKGROUP<0> and WORKGROUP<1e> group names to the unicast subnet * also for the same reasons. */ |