svn commit: samba r24028 - in branches/SAMBA_3_2_0/source: nmbd param

metze at samba.org metze at samba.org
Tue Jul 24 10:25:10 GMT 2007


Author: metze
Date: 2007-07-24 10:25:09 +0000 (Tue, 24 Jul 2007)
New Revision: 24028

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24028

Log:
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
Modified:
   branches/SAMBA_3_2_0/source/nmbd/nmbd_mynames.c
   branches/SAMBA_3_2_0/source/param/loadparm.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/nmbd/nmbd_mynames.c
===================================================================
--- branches/SAMBA_3_2_0/source/nmbd/nmbd_mynames.c	2007-07-24 10:24:27 UTC (rev 24027)
+++ branches/SAMBA_3_2_0/source/nmbd/nmbd_mynames.c	2007-07-24 10:25:09 UTC (rev 24028)
@@ -114,6 +114,7 @@
 {
 	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 @@
 	}
 
 	/*
+	 * 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.
 	 */

Modified: branches/SAMBA_3_2_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_3_2_0/source/param/loadparm.c	2007-07-24 10:24:27 UTC (rev 24027)
+++ branches/SAMBA_3_2_0/source/param/loadparm.c	2007-07-24 10:25:09 UTC (rev 24028)
@@ -253,6 +253,7 @@
 	char *szCupsServer;
 	char *szIPrintServer;
 	char *ctdbdSocket;
+	char **szClusterAddresses;
 	BOOL clustering;
 	int ldap_passwd_sync; 
 	int ldap_replication_sleep;
@@ -1049,6 +1050,7 @@
 
 	{"name cache timeout", P_INTEGER, P_GLOBAL, &Globals.name_cache_timeout, NULL, NULL, FLAG_ADVANCED}, 
 	{"ctdbd socket", P_STRING, P_GLOBAL, &Globals.ctdbdSocket, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, 
+	{"cluster addresses", P_LIST, P_GLOBAL, &Globals.szClusterAddresses, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, 
 	{"clustering", P_BOOL, P_GLOBAL, &Globals.clustering, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, 
 
 	{N_("Printing Options"), P_SEP, P_SEPARATOR}, 
@@ -1648,6 +1650,7 @@
 	string_set(&Globals.szIPrintServer, "");
 
 	string_set(&Globals.ctdbdSocket, "");
+	Globals.szClusterAddresses = NULL;
 	Globals.clustering = False;
 
 	Globals.winbind_cache_time = 300;	/* 5 minutes */
@@ -2061,6 +2064,7 @@
 FN_GLOBAL_STRING(lp_cups_server, &Globals.szCupsServer)
 FN_GLOBAL_STRING(lp_iprint_server, &Globals.szIPrintServer)
 FN_GLOBAL_CONST_STRING(lp_ctdbd_socket, &Globals.ctdbdSocket)
+FN_GLOBAL_LIST(lp_cluster_addresses, &Globals.szClusterAddresses)
 FN_GLOBAL_BOOL(lp_clustering, &Globals.clustering);
 FN_LOCAL_STRING(lp_printcommand, szPrintcommand)
 FN_LOCAL_STRING(lp_lpqcommand, szLpqcommand)



More information about the samba-cvs mailing list