Skip to content

Commit cd9fc9d

Browse files
Dmitry AkhmedzhanovSimon Raviv
authored andcommitted
Fixed compilation errors if glibc is old (e.g. XenServer 6.5)
Description: Used macro defined in perftest_communication.h instead of htobe64() function introduced in later glibc Signed-off-by: Dmitry Akhmedzhanov <[email protected]>
1 parent 18b2166 commit cd9fc9d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/multicast_resources.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <signal.h>
2323
#include <pthread.h>
2424
#include "multicast_resources.h"
25+
#include "perftest_communication.h"
2526

2627
/* This is when we get sig handler from the user before we remove the join request. */
2728
struct mcast_parameters *sighandler_params;
@@ -63,7 +64,7 @@ static void prepare_mcast_mad(uint8_t method,
6364
ptr[1] = MANAGMENT_CLASS_SUBN_ADM; /* MgmtClass */
6465
ptr[2] = 0x02; /* ClassVersion */
6566
ptr[3] = INSERTF(ptr[3], 0, method, 0, 7); /* Method */
66-
(*(uint64_t *)(ptr + 8)) = htobe64((uint64_t)DEF_TRANS_ID); /* TransactionID */
67+
(*(uint64_t *)(ptr + 8)) = ntoh_64((uint64_t)DEF_TRANS_ID); /* TransactionID */
6768
(*(uint16_t *)(ptr + 16)) = htons(SUBN_ADM_ATTR_MC_MEMBER_RECORD); /* AttributeID */
6869

6970
ptr = samad_packet->SubnetAdminData;
@@ -84,7 +85,7 @@ static void prepare_mcast_mad(uint8_t method,
8485
SUBN_ADM_COMPMASK_P_KEY | SUBN_ADM_COMPMASK_TCLASS | SUBN_ADM_COMPMASK_SL |
8586
SUBN_ADM_COMPMASK_FLOW_LABEL | SUBN_ADM_COMPMASK_JOIN_STATE;
8687

87-
samad_packet->ComponentMask = htobe64(comp_mask);
88+
samad_packet->ComponentMask = ntoh_64(comp_mask);
8889
}
8990

9091
/******************************************************************************

0 commit comments

Comments
 (0)