* [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
* Re: [libnftnl PATCH] examples: nft-rule-add: Fix compile on musl libc
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
0 siblings, 1 reply; 3+ messages in thread
From: Pablo Neira Ayuso @ 2026-03-20 11:48 UTC (permalink / raw)
To: Anna Wilcox; +Cc: netfilter-devel
On Fri, Mar 20, 2026 at 03:43:04AM -0500, Anna Wilcox wrote:
> 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'
Do more examples need this?
> 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 [flat|nested] 3+ messages in thread
* Re: [libnftnl PATCH] examples: nft-rule-add: Fix compile on musl libc
2026-03-20 11:48 ` Pablo Neira Ayuso
@ 2026-03-22 8:19 ` A. Wilcox
0 siblings, 0 replies; 3+ messages in thread
From: A. Wilcox @ 2026-03-22 8:19 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel
On Mar 20, 2026, at 6:48 AM, Pablo Neira Ayuso <pablo@netfilter.org>
wrote:
>
> On Fri, Mar 20, 2026 at 03:43:04AM -0500, Anna Wilcox wrote:
>> 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'
>
> Do more examples need this?
No. The libnftnl test suite passes fully once this patch is applied.
Best,
-Anna
^ permalink raw reply [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