examples: nft-rule-add: Fix compile on musl libc
PATCH 1/1 examples: nft-rule-add: Fix compile on musl libc
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 <[email protected]>
--- examples/nft-rule-add.c | 1 + 1 file changed, 1 insertion(+)
examples/nft-rule-add.c +1 -0
@@ -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>
Signature · 1 line
2.52.0
Pablo Neira Ayuso
maintainerQuoted 4 lines · Anna Wilcox
Without
_GNU_SOURCE, thedestfield ontcphdris 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?
Quoted 21 lines
Signed-off-by Anna Wilcox <[email protected]>--- examples/nft-rule-add.c | 1 + 1 file changed, 1 insertion(+)examples/nft-rule-add.c +1
-0@@ -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> Signature · 1 line
2.52.0
Quoted 8 lines · Pablo Neira Ayuso
Quoted 4 lines · Anna Wilcox
Without
_GNU_SOURCE, thedestfield ontcphdris 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