]> git.ipfire.org Git - thirdparty/libnftnl.git/commitdiff
examples: nft-rule-add: Fix compile on musl libc master
authorAnna Wilcox <AWilcox@Wilcox-Tech.com>
Fri, 20 Mar 2026 08:43:04 +0000 (03:43 -0500)
committerFlorian Westphal <fw@strlen.de>
Fri, 20 Mar 2026 10:25:20 +0000 (11:25 +0100)
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>
Signed-off-by: Florian Westphal <fw@strlen.de>
examples/nft-rule-add.c

index 937b4366a29b86470ceb38e15e3a93b8628b5ad2..486544ae3a376aee5cc0337157b4cf5bac3066a9 100644 (file)
@@ -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>