[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/ccs/daemon cnx_mgr.c

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	rohara sourceware org	2007-12-11 20:56:45

Modified files:
	ccs/daemon     : cnx_mgr.c 

Log message:
	BZ 418961
	Fix issue with endian conversion that caused problems for mixed architecture
	nodes on same subnet. Need to correct swap byte ordering of comm_header_t
	structure before copying into buffer and when dereferencing.


--- cluster/ccs/daemon/cnx_mgr.c	2007/03/19 20:03:15
+++ cluster/ccs/daemon/cnx_mgr.c	2007/12/11 20:56:45
@@ -1363,18 +1363,19 @@
     ch->comm_flags |= COMM_BROADCAST_FROM_QUORATE;
+  swab_header(ch);
   memcpy(buffer, ch, sizeof(comm_header_t));
+  swab_header(ch); /* Swab back to dip into ch for payload_size */
   memcpy(buffer+sizeof(comm_header_t), payload, ch->comm_payload_size);
   log_dbg("Sending cluster.conf (version %d)...\n", get_doc_version(master_doc->od_doc));
   sendlen = ch->comm_payload_size + sizeof(comm_header_t);
-  swab_header(ch);
   if(sendto(sfd, buffer, sendlen, 0,
 	    (struct sockaddr *)&addr, (socklen_t)len) < 0){
     log_sys_err("Sendto failed");
     error = -errno;
   if(buffer) free(buffer);
   if(payload) free(payload);

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]