Просмотр исходного кода

Forward port the clear_node_high_bit from whitetank

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2205 fd59a12c-fef9-0310-b244-a6a79926bd2f
Andrew Beekhof 16 лет назад
Родитель
Сommit
446eb5946c
4 измененных файлов с 20 добавлено и 1 удалено
  1. 7 0
      exec/totemconfig.c
  2. 1 1
      exec/totemnet.c
  3. 1 0
      include/corosync/totem/totem.h
  4. 11 0
      man/corosync.conf.5

+ 7 - 0
exec/totemconfig.c

@@ -323,6 +323,13 @@ printf ("couldn't find totem handle\n");
 	 */
 	objdb_get_int (objdb, object_totem_handle, "nodeid", &totem_config->node_id);
 
+	totem_config->clear_node_high_bit = 0;
+	if (!objdb_get_string (objdb,object_totem_handle, "clear_node_high_bit", &str)) {
+		if (strcmp (str, "yes") == 0) {
+			totem_config->clear_node_high_bit = 1;
+		}
+	}
+	
 	objdb_get_int (objdb,object_totem_handle, "threads", &totem_config->threads);
 
 

+ 1 - 1
exec/totemnet.c

@@ -1230,7 +1230,7 @@ static int netif_determine (
 
 	res = totemip_iface_check (bindnet, bound_to,
 		interface_up, interface_num,
-                0); // TODO andrew can address this instance->totem_config->clear_node_high_bit);
+                instance->totem_config->clear_node_high_bit);
 
 
 	return (res);

+ 1 - 0
include/corosync/totem/totem.h

@@ -88,6 +88,7 @@ struct totem_config {
 	struct totem_interface *interfaces;
 	unsigned int interface_count;
 	unsigned int node_id;
+	unsigned int clear_node_high_bit;
 
 	/*
 	 * key information

+ 11 - 0
man/corosync.conf.5

@@ -140,6 +140,17 @@ will be determined from the 32 bit IP address the system to which the system
 is bound with ring identifier of 0.  The node identifier value of zero is
 reserved and should not be used.
 
+.TP
+clear_node_high_bit
+This configuration option is optional and is only relevant when no nodeid is
+specified.  Some openais clients require a signed 32 bit nodeid that is greater
+than zero however by default openais uses all 32 bits of the IPv4 address space
+when generating a nodeid.  Set this option to yes to force the high bit to be
+zero and therefor ensure the nodeid is a positive signed 32 bit integer.
+
+WARNING: The clusters behavior is undefined if this option is enabled on only
+a subset of the cluster (for example during a rolling upgrade).
+
 .TP
 secauth
 This specifies that HMAC/SHA1 authentication should be used to authenticate