diff mbox series

[iptables,2/2] xshared: fix compilation with musl

Message ID 20220514163325.54266-2-vincent@systemli.org
State Changes Requested
Delegated to: Pablo Neira
Headers show
Series [iptables,1/2] xtables: fix compilation with musl | expand

Commit Message

Nick May 14, 2022, 4:33 p.m. UTC
Gcc complains about missing types. Include <sys/types.h> to fix it.

Fixes errors in the form of:
In file included from xtables-legacy-multi.c:5:
xshared.h:83:56: error: unknown type name 'u_int16_t'; did you mean 'uint16_t'?
   83 | set_option(unsigned int *options, unsigned int option, u_int16_t *invflg,
      |                                                        ^~~~~~~~~
      |                                                        uint16_t
make[6]: *** [Makefile:712: xtables_legacy_multi-xtables-legacy-multi.o] Error 1

Signed-off-by: Nick Hainke <vincent@systemli.org>
---
 iptables/xshared.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Phil Sutter May 14, 2022, 5:09 p.m. UTC | #1
On Sat, May 14, 2022 at 06:33:25PM +0200, Nick Hainke wrote:
> Gcc complains about missing types. Include <sys/types.h> to fix it.
> 
> Fixes errors in the form of:
> In file included from xtables-legacy-multi.c:5:
> xshared.h:83:56: error: unknown type name 'u_int16_t'; did you mean 'uint16_t'?
>    83 | set_option(unsigned int *options, unsigned int option, u_int16_t *invflg,
>       |                                                        ^~~~~~~~~
>       |                                                        uint16_t
> make[6]: *** [Makefile:712: xtables_legacy_multi-xtables-legacy-multi.o] Error 1

Does it work if you change the type to uint16_t instead? This looks like
fixing for a typo in f647f61f273a1 ("xtables: Make invflags 16bit wide")
which I didn't notice.

Thanks, Phil
diff mbox series

Patch

diff --git a/iptables/xshared.h b/iptables/xshared.h
index 14568bb0..9d2fef90 100644
--- a/iptables/xshared.h
+++ b/iptables/xshared.h
@@ -4,6 +4,7 @@ 
 #include <limits.h>
 #include <stdbool.h>
 #include <stdint.h>
+#include <sys/types.h>
 #include <netinet/in.h>
 #include <net/if.h>
 #include <linux/netfilter_arp/arp_tables.h>