defect 833

Rabbe reported that the encoding of the ipv4 address in SaClmNodeAddressT is incorrect


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@804 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Steven Dake 2005-08-25 22:09:03 +00:00
parent 42468e12a0
commit 478307dfed
2 changed files with 6 additions and 5 deletions

View File

@ -199,10 +199,10 @@ static int clm_exec_init_fn (struct openais_config *openais_config)
* Build local cluster node data structure
*/
thisClusterNode.nodeId = this_ip->sin_addr.s_addr;
memcpy (&thisClusterNode.nodeAddress.value, &this_ip->sin_addr,
sizeof (struct in_addr));
thisClusterNode.nodeAddress.length = sizeof (struct in_addr);
strcpy ((char *)thisClusterNode.nodeName.value, (char *)inet_ntoa (this_ip->sin_addr));
sprintf (thisClusterNode.nodeAddress.value, "%s", inet_ntoa (this_ip->sin_addr));
thisClusterNode.nodeAddress.length = strlen (thisClusterNode.nodeAddress.value);
thisClusterNode.nodeAddress.family = SA_CLM_AF_INET;
sprintf (thisClusterNode.nodeName.value, "%s", inet_ntoa (this_ip->sin_addr));
thisClusterNode.nodeName.length = strlen ((char *)thisClusterNode.nodeName.value);
thisClusterNode.member = 1;
{

View File

@ -48,8 +48,9 @@
void printSaClmNodeAddressT (SaClmNodeAddressT *nodeAddress) {
int i;
printf ("family=%d - address=", nodeAddress->family);
for (i = 0; i < nodeAddress->length; i++) {
printf ("%d.", nodeAddress->value[i]);
printf ("%c", nodeAddress->value[i]);
}
}