From: Anna Wilcox <AWilcox@Wilcox-Tech.com>
To: netfilter-devel@vger.kernel.org
Cc: Anna Wilcox <AWilcox@Wilcox-Tech.com>
Subject: [libnftnl PATCH] examples: nft-rule-add: Fix compile on musl libc
Date: Fri, 20 Mar 2026 03:43:04 -0500 [thread overview]
Message-ID: <20260320084340.26543-2-AWilcox@Wilcox-Tech.com> (raw)
Without `_GNU_SOURCE`, the `dest` field on `tcphdr` is not present:
nft-rule-add.c: In function 'setup_rule':
nft-rule-add.c:108:21: error: 'struct tcphdr' has no member named 'dest'
Signed-off-by: Anna Wilcox <AWilcox@Wilcox-Tech.com>
---
examples/nft-rule-add.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/examples/nft-rule-add.c b/examples/nft-rule-add.c
index 937b436..486544a 100644
--- a/examples/nft-rule-add.c
+++ b/examples/nft-rule-add.c
@@ -5,6 +5,7 @@
* This software has been sponsored by Sophos Astaro <http://www.sophos.com>
*/
+#define _GNU_SOURCE /* for tcphdr.dest */
#include <stdlib.h>
#include <time.h>
#include <string.h>
--
2.52.0
next reply other threads:[~2026-03-20 8:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-20 8:43 Anna Wilcox [this message]
2026-03-20 11:48 ` [libnftnl PATCH] examples: nft-rule-add: Fix compile on musl libc Pablo Neira Ayuso
2026-03-22 8:19 ` A. Wilcox
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=20260320084340.26543-2-AWilcox@Wilcox-Tech.com \
--to=awilcox@wilcox-tech.com \
--cc=netfilter-devel@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