Skip to content

Commit 4eefd62

Browse files
KAGA-KOKOjgunthorpe
authored andcommitted
include/rdma/opa_addr.h: Fix an endianness issue
IB_MULTICAST_LID_BASE is defined as follows: #define IB_MULTICAST_LID_BASE cpu_to_be16(0xC000) Hence use be16_to_cpu() to convert it to CPU endianness. Compile-tested only. Fixes: af808ec ("IB/SA: Check dlid before SA agent queries for ClassPortInfo") Signed-off-by: Bart Van Assche <[email protected]> Cc: Venkata Sandeep Dhanalakota <[email protected]> Cc: Mike Marciniszyn <[email protected]> Cc: Dennis Dalessandro <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 1c77483 commit 4eefd62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/rdma/opa_addr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static inline bool rdma_is_valid_unicast_lid(struct rdma_ah_attr *attr)
120120
if (attr->type == RDMA_AH_ATTR_TYPE_IB) {
121121
if (!rdma_ah_get_dlid(attr) ||
122122
rdma_ah_get_dlid(attr) >=
123-
be32_to_cpu(IB_MULTICAST_LID_BASE))
123+
be16_to_cpu(IB_MULTICAST_LID_BASE))
124124
return false;
125125
} else if (attr->type == RDMA_AH_ATTR_TYPE_OPA) {
126126
if (!rdma_ah_get_dlid(attr) ||

0 commit comments

Comments
 (0)