Skip to contentSkip to conversation

Introduce compat.h file to deal with old Linux api and fix build failure due to missing NETLINK_EXT_ACK

PATCH New Giulio Benetti 1 participant 1 message Apr 7

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Introduce compat.h file to deal with old Linux api and fix build failure due to missing NETLINK_EXT_ACK

Check if NETLINK_EXT_ACK exists, otherwise define it to fix build failure.

---
 support/export/cache.c       |  2 ++
 support/export/cache_flush.c |  2 ++
 support/include/compat.h     | 10 ++++++++++
 utils/nfsdctl/nfsdctl.c      |  1 +
 4 files changed, 15 insertions(+)
 create mode 100644 support/include/compat.h
support/export/cache.c +2 -0
index 2f128d7d..ca75a1ce 100644
@@ -58,6 +58,8 @@
 #include "blkid/blkid.h"
 #endif
 
+#include "compat.h"
+
 enum nfsd_fsid {
 	FSID_DEV = 0,
 	FSID_NUM,
support/export/cache_flush.c +2 -0
index ed7b964f..2a24dec7 100644
@@ -38,6 +38,8 @@ extern int no_netlink;
 #include "sunrpc_netlink.h"
 #endif
 
+#include "compat.h"
+
 static int nl_send_flush(struct nl_sock *sock, int family, int cmd)
 {
 	struct nl_msg *msg;
support/include/compat.h new file +10 -0
new file mode 100644
index 00000000..83229b65
@@ -0,0 +1,10 @@
+#ifndef COMPAT_H
+#define COMPAT_H
+
+#include <linux/netlink.h>
+
+#ifndef NETLINK_EXT_ACK
+#define NETLINK_EXT_ACK 11
+#endif
+
+#endif /* COMPAT_H */
utils/nfsdctl/nfsdctl.c +1 -0
index 016dd2eb..fb326640 100644
@@ -45,6 +45,7 @@
 
 #include "nfslib.h"
 #include "nfsdctl.h"
+#include "compat.h"
 #include "conffile.h"
 #include "xlog.h"
 
Signature · 1 line
2.47.3