From 885eeddfad97ee68495afcd3f2ff6a9f941261f3 Mon Sep 17 00:00:00 2001
Date: Tue, 18 Dec 2018 15:36:48 +0100
Subject: [PATCH] client: ensure OFED_INCLUDE_PATH is valid

check if `rdma/rdma_cm.h` exists at that path, if specified.
---
 build/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/build/Makefile b/build/Makefile
index b3126d9..0c9cf8c 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -93,7 +93,12 @@ BEEGFS_CFLAGS += -DBEEGFS_OPENTK_IBVERBS
 endif
 
 ifneq ($(OFED_INCLUDE_PATH),)
+
 BEEGFS_CFLAGS += -I$(OFED_INCLUDE_PATH)
+
+module: $(OFED_INCLUDE_PATH)/rdma/rdma_cm.h
+$(OFED_INCLUDE_PATH)/rdma/rdma_cm.h:
+	$(error OFED_INCLUDE_PATH not valid: $(OFED_INCLUDE_PATH))
 endif
 
 # OFED API version
-- 
1.8.3.1

From 17298089c45a1808e860c86292c1a47b854bf513 Mon Sep 17 00:00:00 2001
Date: Tue, 18 Dec 2018 16:01:43 +0100
Subject: [PATCH] client: fix build with MLNX OFED 4.5

---
 source/common/net/sock/ibv/IBVSocket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/common/net/sock/ibv/IBVSocket.c b/source/common/net/sock/ibv/IBVSocket.c
index 233b855..bb95f4e 100644
--- a/source/common/net/sock/ibv/IBVSocket.c
+++ b/source/common/net/sock/ibv/IBVSocket.c
@@ -1810,7 +1810,7 @@ struct ib_cq* __IBVSocket_createCompletionQueue(struct ib_device* device,
 {
    #if defined (BEEGFS_OFED_1_2_API) && BEEGFS_OFED_1_2_API >= 1
       return ib_create_cq(device, comp_handler, event_handler, cq_context, cqe);
-   #elif defined OFED_HAS_IB_CREATE_CQATTR
+   #elif defined(OFED_HAS_IB_CREATE_CQATTR) || defined(ib_create_cq)
       struct ib_cq_init_attr attrs = {
          .cqe = cqe,
          .comp_vector = 0,
-- 
1.8.3.1

