public inbox for netfilter-devel@vger.kernel.org
 help / color / mirror / Atom feed
* [libnftnl PATCH] examples: nft-rule-add: Fix compile on musl libc
@ 2026-03-20  8:43 Anna Wilcox
  2026-03-20 11:48 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: Anna Wilcox @ 2026-03-20  8:43 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Anna Wilcox

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-22  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20  8:43 [libnftnl PATCH] examples: nft-rule-add: Fix compile on musl libc Anna Wilcox
2026-03-20 11:48 ` Pablo Neira Ayuso
2026-03-22  8:19   ` A. Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox