From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: linux-nfs@vger.kernel.org
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
Subject: [PATCH] Introduce compat.h file to deal with old Linux api and fix build failure due to missing NETLINK_EXT_ACK
Date: Tue, 7 Apr 2026 17:50:45 +0200 [thread overview]
Message-ID: <20260407155045.1176993-1-giulio.benetti@benettiengineering.com> (raw)
Check if NETLINK_EXT_ACK exists, otherwise define it to fix build
failure.
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
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
diff --git a/support/export/cache.c b/support/export/cache.c
index 2f128d7d..ca75a1ce 100644
--- a/support/export/cache.c
+++ b/support/export/cache.c
@@ -58,6 +58,8 @@
#include "blkid/blkid.h"
#endif
+#include "compat.h"
+
enum nfsd_fsid {
FSID_DEV = 0,
FSID_NUM,
diff --git a/support/export/cache_flush.c b/support/export/cache_flush.c
index ed7b964f..2a24dec7 100644
--- a/support/export/cache_flush.c
+++ b/support/export/cache_flush.c
@@ -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;
diff --git a/support/include/compat.h b/support/include/compat.h
new file mode 100644
index 00000000..83229b65
--- /dev/null
+++ b/support/include/compat.h
@@ -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 */
diff --git a/utils/nfsdctl/nfsdctl.c b/utils/nfsdctl/nfsdctl.c
index 016dd2eb..fb326640 100644
--- a/utils/nfsdctl/nfsdctl.c
+++ b/utils/nfsdctl/nfsdctl.c
@@ -45,6 +45,7 @@
#include "nfslib.h"
#include "nfsdctl.h"
+#include "compat.h"
#include "conffile.h"
#include "xlog.h"
--
2.47.3
reply other threads:[~2026-04-07 15:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260407155045.1176993-1-giulio.benetti@benettiengineering.com \
--to=giulio.benetti@benettiengineering.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).