From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Anna Wilcox <AWilcox@wilcox-tech.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [libnftnl PATCH] examples: nft-rule-add: Fix compile on musl libc
Date: Fri, 20 Mar 2026 12:48:00 +0100 [thread overview]
Message-ID: <ab0z8HmTHljlaUEg@chamomile> (raw)
In-Reply-To: <20260320084340.26543-2-AWilcox@Wilcox-Tech.com>
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
>
>
next prev parent reply other threads:[~2026-03-20 11:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=ab0z8HmTHljlaUEg@chamomile \
--to=pablo@netfilter.org \
--cc=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