Selaa lähdekoodia

defect 1191
Add more support for the redundant ring protocol.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@976 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 20 vuotta sitten
vanhempi
commit
bf65af760d
10 muutettua tiedostoa jossa 178 lisäystä ja 133 poistoa
  1. 8 6
      conf/openais.conf
  2. 7 5
      exec/aisparser.c
  3. 4 2
      exec/main.c
  4. 1 2
      exec/mainconfig.c
  5. 1 2
      exec/mainconfig.h
  6. 3 3
      exec/totem.h
  7. 106 77
      exec/totemconfig.c
  8. 20 20
      exec/totemnet.c
  9. 1 1
      exec/totemsrp.c
  10. 27 15
      man/openais.conf.5

+ 8 - 6
conf/openais.conf

@@ -1,13 +1,15 @@
 # Please read the openais.conf.5 manual page
 
 totem {
-	version: 1
+	version: 2
 	secauth: off
-	bindnetaddr: 192.168.2.0
-	mcastaddr: 226.94.1.1
-	mcastport: 5405
-	netmtu: 1500
 	threads: 0
+	interface {
+		ringnumber: 0
+		bindnetaddr: 192.168.2.0
+		mcastaddr: 226.94.1.1
+		mcastport: 5405
+	}
 }
 
 logging {
@@ -18,5 +20,5 @@ logging {
 }
 
 amf {
-	mode: enabled
+	mode: disabled
 }

+ 7 - 5
exec/aisparser.c

@@ -109,7 +109,7 @@ char *strstr_rs (const char *haystack, const char *needle)
 
 static int parse_section(FILE *fp,
 			 struct objdb_iface_ver0 *objdb,
-			 unsigned int parent_key,
+			 unsigned int parent_handle,
 			 char **error_string)
 {
 	char line[512];
@@ -142,7 +142,8 @@ static int parse_section(FILE *fp,
 
 			loc--;
 			*loc = '\0';
-			objdb->object_create (OBJECT_PARENT_HANDLE, &new_parent,
+printf ("creating object %d %s\n", parent_handle, section);
+			objdb->object_create (parent_handle, &new_parent,
 					      section, strlen (section));
 			if (parse_section(fp, objdb, new_parent, error_string))
 				return -1;
@@ -156,8 +157,9 @@ static int parse_section(FILE *fp,
 			*(loc-1) = '\0';
 			key = remove_whitespace(line);
 			value = remove_whitespace(loc);
-			objdb->object_key_create (parent_key, key, strlen (key),
-						  value, strlen (value) + 1);
+			objdb->object_key_create (parent_handle, key,
+				strlen (key),
+				value, strlen (value) + 1);
 		}
 
 		if ((loc = strstr_rs (line, "}"))) {
@@ -165,7 +167,7 @@ static int parse_section(FILE *fp,
 		}
 	}
 
-	if (parent_key != OBJECT_PARENT_HANDLE) {
+	if (parent_handle != OBJECT_PARENT_HANDLE) {
 		*error_string = "Missing closing brace";
 		return -1;
 	}

+ 4 - 2
exec/main.c

@@ -1217,7 +1217,8 @@ int main (int argc, char **argv)
 
 	openais_service_link_all (objdb);
 
-	res = openais_main_config_read (objdb, &error_string, &main_config, 1);
+printf ("main config read\n");
+	res = openais_main_config_read (objdb, &error_string, &main_config);
 	if (res == -1) {
 		log_printf (LOG_LEVEL_NOTICE, "AIS Executive Service: Copyright (C) 2002-2006 MontaVista Software, Inc and contributors.\n");
 
@@ -1225,7 +1226,8 @@ int main (int argc, char **argv)
 		openais_exit_error (AIS_DONE_MAINCONFIGREAD);
 	}
 
-	res = totem_config_read (objdb, &totem_config, &error_string, 1);
+  printf ("totem config read\n");
+	res = totem_config_read (objdb, &totem_config, &error_string, 3);
 	if (res == -1) {
 		log_printf (LOG_LEVEL_NOTICE, "AIS Executive Service: Copyright (C) 2002-2006 MontaVista Software, Inc and contributors.\n");
 		log_printf (LOG_LEVEL_ERROR, error_string);

+ 1 - 2
exec/mainconfig.c

@@ -80,8 +80,7 @@ static inline int objdb_get_string(struct objdb_iface_ver0 *objdb, unsigned int
 extern int openais_main_config_read (
 	struct objdb_iface_ver0 *objdb,
 	char **error_string,
-	struct main_config *main_config,
-	int interface_max)
+	struct main_config *main_config)
 {
 	unsigned int object_service_handle;
 	char *value;

+ 1 - 2
exec/mainconfig.h

@@ -70,7 +70,6 @@ extern char *strstr_rs (const char *haystack, const char *needle);
 extern int openais_main_config_read (
 	struct objdb_iface_ver0 *objdb,
 	char **error_string,
-	struct main_config *main_config,
-	int interface_max);
+	struct main_config *main_config);
 	
 #endif /* MAINCONFIG_H_DEFINED */

+ 3 - 3
exec/totem.h

@@ -64,6 +64,9 @@ enum {
 struct totem_interface {
 	struct totem_ip_address bindnet;
 	struct totem_ip_address boundto;
+	struct totem_ip_address mcast_addr;
+	uint16_t ip_port;
+	int node_id;
 };
 
 struct totem_logging_configuration {
@@ -83,9 +86,6 @@ struct totem_config {
 	 */
 	struct totem_interface *interfaces;
 	int interface_count;
-	struct totem_ip_address mcast_addr;
-	uint16_t ip_port;
-	int node_id;
 
 	/*
 	 * key information

+ 106 - 77
exec/totemconfig.c

@@ -77,8 +77,9 @@
 static char error_string_response[512];
 
 /* These just makes the code below a little neater */
-static inline int objdb_get_string(struct objdb_iface_ver0 *objdb, unsigned int object_service_handle,
-				   char *key, char **value)
+static inline int objdb_get_string (
+	struct objdb_iface_ver0 *objdb, unsigned int object_service_handle,
+	char *key, char **value)
 {
 	int res;
 
@@ -94,8 +95,9 @@ static inline int objdb_get_string(struct objdb_iface_ver0 *objdb, unsigned int
 	return -1;
 }
 
-static inline void objdb_get_int(struct objdb_iface_ver0 *objdb, unsigned int object_service_handle,
-				   char *key, unsigned int *intvalue)
+static inline void objdb_get_int (
+	struct objdb_iface_ver0 *objdb, unsigned int object_service_handle,
+	char *key, unsigned int *intvalue)
 {
 	char *value = NULL;
 
@@ -119,9 +121,11 @@ extern int totem_config_read (
 {
 	int res = 0;
 	int parse_done = 0;
-	unsigned int object_service_handle;
-	char *value;
+	unsigned int object_totem_handle;
+	unsigned int object_interface_handle;
+	char *str;
 	char *error_reason = error_string_response;
+	unsigned int ringnumber = 0;
 
 	memset (totem_config, 0, sizeof (struct totem_config));
 	totem_config->interfaces = malloc (sizeof (struct totem_interface) * interface_max);
@@ -142,80 +146,101 @@ extern int totem_config_read (
 		    OBJECT_PARENT_HANDLE,
 		    "network",
 		    strlen ("network"),
-		    &object_service_handle) == 0 ||
+		    &object_totem_handle) == 0 ||
 	    objdb->object_find (
 		    OBJECT_PARENT_HANDLE,
 		    "totem",
 		    strlen ("totem"),
-		    &object_service_handle) == 0) {
+		    &object_totem_handle) == 0) {
 
-		if (!objdb_get_string (objdb,object_service_handle, "version", &value)) {
-			if (strcmp (value, "1") == 0) {
-				totem_config->version = 1;
+		if (!objdb_get_string (objdb,object_totem_handle, "version", &str)) {
+			if (strcmp (str, "2") == 0) {
+				totem_config->version = 2;
 			}
 		}
-		if (!objdb_get_string (objdb,object_service_handle, "secauth", &value)) {
-			if (strcmp (value, "on") == 0) {
+		if (!objdb_get_string (objdb,object_totem_handle, "secauth", &str)) {
+			if (strcmp (str, "on") == 0) {
 				totem_config->secauth = 1;
 			}
-			if (strcmp (value, "off") == 0) {
+			if (strcmp (str, "off") == 0) {
 				totem_config->secauth = 0;
 			}
 		}
-		objdb_get_int (objdb,object_service_handle, "threads", &totem_config->threads);
+		objdb_get_int (objdb,object_totem_handle, "threads", &totem_config->threads);
 
-		objdb_get_int (objdb,object_service_handle, "nodeid", &totem_config->node_id);
 
-		objdb_get_int (objdb,object_service_handle, "netmtu", &totem_config->net_mtu);
+		objdb_get_int (objdb,object_totem_handle, "netmtu", &totem_config->net_mtu);
 
-		if (!objdb_get_string (objdb,object_service_handle, "mcastaddr", &value)) {
-			res = totemip_parse (&totem_config->mcast_addr, value);
-		}
+		objdb_get_int (objdb,object_totem_handle, "token", &totem_config->token_timeout);
 
-		if (!objdb_get_string (objdb,object_service_handle, "mcastport", &value)) {
-			totem_config->ip_port = htons (atoi (value));
-		}
+		objdb_get_int (objdb,object_totem_handle, "token_retransmit", &totem_config->token_retransmit_timeout);
 
-		// TODO This really expects a list....copy stuff from services ?
-		if (!objdb_get_string (objdb,object_service_handle, "bindnetaddr", &value)) {
+		objdb_get_int (objdb,object_totem_handle, "hold", &totem_config->token_hold_timeout);
 
-			if (interface_max == totem_config->interface_count) {
-				sprintf (error_reason,
-					 "%d is too many interfaces in %s/network.conf",
-					 totem_config->interface_count, OPENAIS_CONFDIR);
-				goto parse_error;
-			}
-			res = totemip_parse (&totem_config->interfaces[totem_config->interface_count].bindnet, value);
-			totem_config->interface_count += 1;
-		}
+		objdb_get_int (objdb,object_totem_handle, "token_retransmits_before_loss_const", &totem_config->token_retransmits_before_loss_const);
+
+		objdb_get_int (objdb,object_totem_handle, "join", &totem_config->join_timeout);
+
+		objdb_get_int (objdb,object_totem_handle, "consensus", &totem_config->consensus_timeout);
 
-		objdb_get_int (objdb,object_service_handle, "token", &totem_config->token_timeout);
+		objdb_get_int (objdb,object_totem_handle, "merge", &totem_config->merge_timeout);
 
-		objdb_get_int (objdb,object_service_handle, "token_retransmit", &totem_config->token_retransmit_timeout);
+		objdb_get_int (objdb,object_totem_handle, "downcheck", &totem_config->downcheck_timeout);
 
-		objdb_get_int (objdb,object_service_handle, "hold", &totem_config->token_hold_timeout);
+		objdb_get_int (objdb,object_totem_handle, "fail_recv_const", &totem_config->fail_to_recv_const);
 
-		objdb_get_int (objdb,object_service_handle, "token_retransmits_before_loss_const", &totem_config->token_retransmits_before_loss_const);
+		objdb_get_int (objdb,object_totem_handle, "seqno_unchanged_const", &totem_config->seqno_unchanged_const);
 
-		objdb_get_int (objdb,object_service_handle, "join", &totem_config->join_timeout);
+		objdb_get_int (objdb,object_totem_handle, "heartbeat_failures_allowed", &totem_config->heartbeat_failures_allowed);
 
-		objdb_get_int (objdb,object_service_handle, "consensus", &totem_config->consensus_timeout);
+		objdb_get_int (objdb,object_totem_handle, "max_network_delay", &totem_config->max_network_delay);
 
-		objdb_get_int (objdb,object_service_handle, "merge", &totem_config->merge_timeout);
+		objdb_get_int (objdb,object_totem_handle, "window_size", &totem_config->window_size);
+
+		objdb_get_int (objdb,object_totem_handle, "max_messages", &totem_config->max_messages);
+	}
+	while (objdb->object_find (
+		    object_totem_handle,
+		    "interface",
+		    strlen ("interface"),
+		    &object_interface_handle) == 0) {
 
-		objdb_get_int (objdb,object_service_handle, "downcheck", &totem_config->downcheck_timeout);
+		if (interface_max == totem_config->interface_count) {
+			sprintf (error_reason,
+				 "%d is too many interfaces in %s/network.conf",
+				 totem_config->interface_count, OPENAIS_CONFDIR);
+			goto parse_error;
+		}
 
-		objdb_get_int (objdb,object_service_handle, "fail_recv_const", &totem_config->fail_to_recv_const);
+		objdb_get_int (objdb, object_interface_handle, "ringnumber", &ringnumber);
 
-		objdb_get_int (objdb,object_service_handle, "seqno_unchanged_const", &totem_config->seqno_unchanged_const);
+		/*
+		 * Get interface node id
+		 */
+		objdb_get_int (objdb, object_interface_handle, "nodeid", &totem_config->interfaces[ringnumber].node_id);
 
-		objdb_get_int (objdb,object_service_handle, "heartbeat_failures_allowed", &totem_config->heartbeat_failures_allowed);
+		/*
+		 * Get interface multicast address
+		 */
+		if (!objdb_get_string (objdb, object_interface_handle, "mcastaddr", &str)) {
+			res = totemip_parse (&totem_config->interfaces[ringnumber].mcast_addr, str);
+		}
 
-		objdb_get_int (objdb,object_service_handle, "max_network_delay", &totem_config->max_network_delay);
+		/*
+		 * Get mcast port
+		 */
+		if (!objdb_get_string (objdb, object_interface_handle, "mcastport", &str)) {
+			totem_config->interfaces[ringnumber].ip_port = htons (atoi (str));
+		}
 
-		objdb_get_int (objdb,object_service_handle, "window_size", &totem_config->window_size);
+		/*
+		 * Get the bind net address
+		 */
+		if (!objdb_get_string (objdb, object_interface_handle, "bindnetaddr", &str)) {
 
-		objdb_get_int (objdb,object_service_handle, "max_messages", &totem_config->max_messages);
+			res = totemip_parse (&totem_config->interfaces[ringnumber].bindnet, str);
+		}
+		totem_config->interface_count++;
 	}
 
 	return 0;
@@ -237,34 +262,48 @@ int totem_config_validate (
 {
 	static char local_error_reason[512];
 	char *error_reason = local_error_reason;
+	int i;
 
-	/*
-	 * Some error checking of parsed data to make sure its valid
-	 */
-	if ((int *)&totem_config->mcast_addr.addr == 0) {
-		error_reason = "No multicast address specified";
+	if (totem_config->interface_count == 0) {
+		error_reason = "No interfaces defined";
 		goto parse_error;
 	}
 
-	if (totem_config->ip_port == 0) {
-		error_reason = "No multicast port specified";
-		goto parse_error;
-	}
+	for (i = 0; i < totem_config->interface_count; i++) {
+printf ("validing interface %d of %d\n", i, totem_config->interfaces);
+		/*
+		 * Some error checking of parsed data to make sure its valid
+		 */
+		if ((int *)&totem_config->interfaces[i].mcast_addr.addr == 0) {
+			error_reason = "No multicast address specified";
+			goto parse_error;
+		}
+	
+		if (totem_config->interfaces[i].ip_port == 0) {
+			error_reason = "No multicast port specified";
+			goto parse_error;
+		}
 
-	if (totem_config->mcast_addr.family == AF_INET6 &&
-		totem_config->node_id == 0) {
+		if (totem_config->interfaces[i].mcast_addr.family == AF_INET6 &&
+			totem_config->interfaces[i].node_id == 0) {
+	
+			error_reason = "An IPV6 network requires that a node ID be specified.";
+			goto parse_error;
+		}
 
-		error_reason = "An IPV6 network requires that a node ID be specified.";
-		goto parse_error;
-	}
+		if (totem_config->interfaces[i].mcast_addr.family != totem_config->interfaces[i].bindnet.family) {
+			error_reason = "Multicast address family does not match bind address family";
+			goto parse_error;
+		}
 
-	if (totem_config->interface_count == 0) {
-		error_reason = "No bindnet specified";
-		goto parse_error;
+		if (totem_config->interfaces[i].mcast_addr.family != totem_config->interfaces[i].bindnet.family) {
+			error_reason =  "Not all bind address belong to the same IP family";
+			goto parse_error;
+		}
 	}
 
-	if (totem_config->version != 1) {
-		error_reason = "This totem parser can only parse version 1 configurations.";
+	if (totem_config->version != 2) {
+		error_reason = "This totem parser can only parse version 2 configurations.";
 		goto parse_error;
 	}
 
@@ -517,16 +556,6 @@ int totem_config_keyread (
 
 	}
 
-	if (totem_config->mcast_addr.family != totem_config->interfaces[0].bindnet.family) {
-		strcpy (error_string_response, "Multicast address family does not match bind address family");
-		goto parse_error;
-	}
-	for (i = 0; i < totem_config->interface_count; i++) {
-		if (totem_config->mcast_addr.family != totem_config->interfaces[i].bindnet.family) {
-			strcpy (error_string_response, "Not all bind address belong to the same IP family");
-			goto parse_error;
-		}
-	}
 	return (0);
 
 parse_error:

+ 20 - 20
exec/totemnet.c

@@ -105,7 +105,7 @@ struct totemnet_instance {
 
 	poll_handle totemnet_poll_handle;
 
-	struct totem_interface *totemnet_interface;
+	struct totem_interface *totem_interface;
 
 	int netif_state_report;
 
@@ -416,7 +416,7 @@ static inline void ucast_sendmsg (
 	 * Build unicast message
 	 */
 	totemip_totemip_to_sockaddr_convert(system_to,
-		instance->totem_config->ip_port, &sockaddr, &addrlen);
+		instance->totem_interface->ip_port, &sockaddr, &addrlen);
 	msg_ucast.msg_name = &sockaddr;
 	msg_ucast.msg_namelen = addrlen;
 	msg_ucast.msg_iov = iovec_sendmsg;
@@ -480,7 +480,7 @@ static inline void mcast_sendmsg (
 	 * Build multicast message
 	 */
 	totemip_totemip_to_sockaddr_convert(&instance->mcast_address,
-		instance->totem_config->ip_port, &sockaddr, &addrlen);
+		instance->totem_interface->ip_port, &sockaddr, &addrlen);
 	msg_mcast.msg_name = &sockaddr;
 	msg_mcast.msg_namelen = addrlen;
 	msg_mcast.msg_iov = iovec_sendmsg;
@@ -551,7 +551,7 @@ static void totemnet_mcast_worker_fn (void *thread_state, void *work_item_in)
 	}
 
 	totemip_totemip_to_sockaddr_convert(&instance->mcast_address,
-		instance->totem_config->ip_port, &sockaddr, &addrlen);
+		instance->totem_interface->ip_port, &sockaddr, &addrlen);
 
 	msg_mcast.msg_name = &sockaddr;
 	msg_mcast.msg_namelen = addrlen;
@@ -729,8 +729,8 @@ static void timer_function_netif_check_timeout (
 	 * Build sockets for every interface
 	 */
 	netif_determine (instance,
-		&instance->totemnet_interface->bindnet,
-		&instance->totemnet_interface->boundto,
+		&instance->totem_interface->bindnet,
+		&instance->totem_interface->boundto,
 		&interface_up, &interface_num);
 	/*
 	 * If the network interface isn't back up and we are already
@@ -789,7 +789,7 @@ static void timer_function_netif_check_timeout (
 		 * Interface is up
 		 */
 		instance->netif_bind_state = BIND_STATE_REGULAR;
-		bind_address = &instance->totemnet_interface->bindnet;
+		bind_address = &instance->totem_interface->bindnet;
 	}
 	/*
 	 * Create and bind the multicast and unicast sockets
@@ -798,7 +798,7 @@ static void timer_function_netif_check_timeout (
 		&instance->mcast_address,
 		bind_address,
 		&instance->totemnet_sockets,
-		&instance->totemnet_interface->boundto);
+		&instance->totem_interface->boundto);
 
 	poll_dispatch_add (
 		instance->totemnet_poll_handle,
@@ -810,7 +810,7 @@ static void timer_function_netif_check_timeout (
 		instance->totemnet_sockets.token,
 		POLLIN, instance, net_deliver_fn, UINT_MAX);
 
-	totemip_copy (&instance->my_id, &instance->totemnet_interface->boundto);
+	totemip_copy (&instance->my_id, &instance->totem_interface->boundto);
 
 	/*
 	 * This reports changes in the interface to the user and totemsrp
@@ -819,7 +819,7 @@ static void timer_function_netif_check_timeout (
 		if (instance->netif_state_report & NETIF_STATE_REPORT_UP) {
 			instance->totemnet_log_printf (instance->totemnet_log_level_notice,
 				"The network interface [%s] is now up.\n",
-				totemip_print (&instance->totemnet_interface->boundto));
+				totemip_print (&instance->totem_interface->boundto));
 			instance->netif_state_report = NETIF_STATE_REPORT_DOWN;
 			instance->totemnet_iface_change_fn (instance->context, &instance->my_id);
 		}
@@ -918,7 +918,7 @@ static int totemnet_build_sockets_ip (
 	 * Bind to multicast socket used for multicast receives
 	 */
 	totemip_totemip_to_sockaddr_convert(mcast_address,
-		instance->totem_config->ip_port, &sockaddr, &addrlen);
+		instance->totem_interface->ip_port, &sockaddr, &addrlen);
 	res = bind (sockets->mcast_recv, (struct sockaddr *)&sockaddr, addrlen);
 	if (res == -1) {
 		perror ("bind mcast recv socket failed");
@@ -950,7 +950,7 @@ static int totemnet_build_sockets_ip (
 		return (-1);
 	}
 
-	totemip_totemip_to_sockaddr_convert(bound_to, instance->totem_config->ip_port - 1,
+	totemip_totemip_to_sockaddr_convert(bound_to, instance->totem_interface->ip_port - 1,
 		&sockaddr, &addrlen);
 	res = bind (sockets->mcast_send, (struct sockaddr *)&sockaddr, addrlen);
 	if (res == -1) {
@@ -987,7 +987,7 @@ static int totemnet_build_sockets_ip (
 	 * Bind to unicast socket used for token send/receives
 	 * This has the side effect of binding to the correct interface
 	 */
-	totemip_totemip_to_sockaddr_convert(bound_to, instance->totem_config->ip_port, &sockaddr, &addrlen);
+	totemip_totemip_to_sockaddr_convert(bound_to, instance->totem_interface->ip_port, &sockaddr, &addrlen);
 	res = bind (sockets->token, (struct sockaddr *)&sockaddr, addrlen);
 	if (res == -1) {
 		perror ("bind token socket failed");
@@ -1017,8 +1017,8 @@ static int totemnet_build_sockets_ip (
 	/*
 	 * Join group membership on socket
 	 */
-	totemip_totemip_to_sockaddr_convert(mcast_address, instance->totem_config->ip_port, &mcast_ss, &addrlen);
-	totemip_totemip_to_sockaddr_convert(bound_to, instance->totem_config->ip_port, &boundto_ss, &addrlen);
+	totemip_totemip_to_sockaddr_convert(mcast_address, instance->totem_interface->ip_port, &mcast_ss, &addrlen);
+	totemip_totemip_to_sockaddr_convert(bound_to, instance->totem_interface->ip_port, &boundto_ss, &addrlen);
 
 	switch ( bindnet_address->family ) {
 		case AF_INET:
@@ -1210,9 +1210,10 @@ int totemnet_initialize (
         rng_make_prng (128, PRNG_SOBER, &instance->totemnet_prng_state, NULL);
 
 	/*
-	* Initialize local variables for totemnet
-	*/
-	totemip_copy (&instance->mcast_address, &totem_config->mcast_addr);
+	 * Initialize local variables for totemnet
+	 */
+	instance->totem_interface = &totem_config->interfaces[interface_no];
+	totemip_copy (&instance->mcast_address, &instance->totem_interface->mcast_addr);
 	memset (instance->iov_buffer, 0, FRAME_SIZE_MAX);
 
 	/*
@@ -1228,10 +1229,9 @@ int totemnet_initialize (
 			totemnet_mcast_worker_fn);
 	}
 
-	instance->totemnet_interface = &totem_config->interfaces[interface_no];
 	instance->totemnet_poll_handle = poll_handle;
 
-	instance->totemnet_interface->bindnet.nodeid = instance->totem_config->node_id;
+	instance->totem_interface->bindnet.nodeid = instance->totem_interface->node_id;
 
 	instance->context = context;
 	instance->totemnet_deliver_fn = deliver_fn;

+ 1 - 1
exec/totemsrp.c

@@ -678,7 +678,7 @@ int totemsrp_initialize (
 	/*
 	 * Initialize local variables for totemsrp
 	 */
-	totemip_copy (&instance->mcast_address, &totem_config->mcast_addr);
+	totemip_copy (&instance->mcast_address, &totem_config->interfaces[0].mcast_addr);
 
 	memset (&instance->next_memb, 0, sizeof (struct totem_ip_address));
 	memset (instance->iov_buffer, 0, FRAME_SIZE_MAX);

+ 27 - 15
man/openais.conf.5

@@ -43,8 +43,8 @@ openais.conf - openais executive configuration file
 The openais.conf instructs the openais executive about various parameters
 needed to control the openais executive.  The configuration file consists of
 bracketed top level directives.  The possible directive choices are
-.IR totem { } "," logging { } "," event { } ", and "amf { }.  These directives
-are described below.
+.IR "totem  { } , logging { } , event { } , and amf { }".
+ These directives are described below.
 
 .TP
 totem { }
@@ -63,11 +63,27 @@ This top level directive contains configuration options for the AMF service.
 .PP
 Within the 
 .B totem
-directive, there are four configuration options which are all required:
+directive, an interface directive is required.  There is also one configuration
+option which is required:
+.PP
+.PP
 .TP
 version
 This specifies the version of the configuration file.  Currently the only
-valid version for this directive is 1.
+valid version for this directive is 2.
+
+.PP
+.PP
+Within the 
+.B interface
+sub-directive of totem there are four parameters which are required unless IPV6
+is used, in which case 5 parameters are required:
+.TP
+ringnumber
+This specifies the ring number for the interface.  When using the redundant
+ring protocol, each interface should specify separate ring numbers to uniquely
+identify to the membership protocol which interface to use for which redundant
+ring.
 
 .TP
 bindnetaddr
@@ -75,10 +91,6 @@ This specifies the address which the openais executive should bind.
 This address should always end in zero.  If the totem traffic should
 be routed over 192.168.5.92, set bindnetaddr to 192.168.5.0.
 
-Multiple bindnetaddr directives may be specified.  When multiple bindnetaddr
-directives are specified, the totem redundant ring protocol will use multiple
-interfaces to replicate the network traffic.
-
 This may also be an IPV6 address, in which case IPV6 networking will be used.
 In this case, the full address must be specified and there is no automatic
 selection of the network interface within a specific subnet as with IPv4.
@@ -106,10 +118,10 @@ nodeid
 This configuration option is optional when using IPv4 and required when using
 IPv6.  This is a 32 bit value specifying the node identifier delivered to the
 cluster membership service.  If this is not specified with IPv4, the node id
-will be determined from the 32 bit IP address the system is bound to.
-
-The node identifier value of zero is reserved and should not be used.
+will be determined from the 32 bit IP address the system to which the system
+is bound.  The node identifier value of zero is reserved and should not be used.
 
+.PP
 .PP
 Within the 
 .B totem 
@@ -145,15 +157,15 @@ The default is on.
 redundantring
 This specifies the mode of redundant ring, which may be none, active, or
 passive.  Active replication offers slightly lower latency from transmit
-to delivery in faulty network environments but with poorer performance.
+to delivery in faulty network environments but with less performance.
 Passive replication may nearly double the speed of the totem protocol
 if the protocol doesn't become cpu bound.  The final option is none, in
 which case only one network interface will be used to operate the totem
 protocol.
 
-At this time redundant ring is only partially implemented and not yet available.
-
-The default is none.
+If only one interface directive is specified, none is automatically chosen.
+If multiple interface directives are specified, only active or passive may
+be chosen.
 
 .TP
 netmtu