Skip to content

Commit

Permalink
Fixed compilation errors if glibc is old (e.g. XenServer 6.5)
Browse files Browse the repository at this point in the history
Description:
    Used macro defined in perftest_communication.h
    instead of htobe64() function introduced in later
    glibc

Signed-off-by: Dmitry Akhmedzhanov <dmitryak@mellanox.com>
  • Loading branch information
Dmitry Akhmedzhanov authored and Simon Raviv committed Oct 9, 2018
1 parent 18b2166 commit cd9fc9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/multicast_resources.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <signal.h>
#include <pthread.h>
#include "multicast_resources.h"
#include "perftest_communication.h"

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

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

samad_packet->ComponentMask = htobe64(comp_mask);
samad_packet->ComponentMask = ntoh_64(comp_mask);
}

/******************************************************************************
Expand Down

0 comments on commit cd9fc9d

Please sign in to comment.