From mboxrd@z Thu Jan 1 00:00:00 1970 From: pcaulfield@sourceware.org Date: 2 Jan 2008 09:27:13 -0000 Subject: [Cluster-devel] cluster/cman/daemon commands.c Message-ID: <20080102092713.6511.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- cluster/cman/daemon/commands.c 2007/12/05 14:28:58 1.77 +++ cluster/cman/daemon/commands.c 2008/01/02 09:27:12 1.78 @@ -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;