Skip to contentSkip to conversation

cluster/cman/daemon commands.c

Cluster-devel [email protected] 1 participant 1 message Jan 2, 2008

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: pcaulfield at sourceware.org 2008-01-02 09:27:12

Modified files:
cman/daemon : commands.c

Log message:
totempg_ifaces_get() always copies INTERFACE_MAX addresses so make sure we alloate enough space for them all.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.77&r2=1.78

cman/daemon/commands.c +3 -3
@@ -345,7 +345,8 @@
 	int addrlen=0;
 	unsigned int numaddrs=1;
 	char **status;
-	struct totem_ip_address node_ifs[num_interfaces];
+	struct totem_ip_address node_ifs[INTERFACE_MAX];
+	/* totempg_ifaces_get always copies INTERFACE_MAX addresses */
 
 	strcpy(unode->name, node->name);
 	unode->jointime = node->join_time;
@@ -361,7 +362,6 @@
 	   must ask for them */
 	totempg_ifaces_get(node->node_id, node_ifs, &status, &numaddrs);
 
-
 	totemip_totemip_to_sockaddr_convert(&node_ifs[0], 0, &ss, &addrlen);
 	memcpy(unode->addr, &ss, addrlen);
 	unode->addrlen = addrlen;
@@ -1173,7 +1173,7 @@
 	int i;
 	char *outbuf = *retbuf + offset;
 	struct cl_get_node_addrs *addrs = (struct cl_get_node_addrs *)outbuf;
-	struct totem_ip_address node_ifs[num_interfaces];
+	struct totem_ip_address node_ifs[INTERFACE_MAX]; /* totempg_ifaces_get always copies INTERFACE_MAX addresses */
 	struct cluster_node *node;
 	char **status;