1 From f319389525b066b7dc6d389c88f16a0df3b8f189 Mon Sep 17 00:00:00 2001
2 From: Nick Hainke <vincent@systemli.org>
3 Date: Mon, 16 May 2022 18:16:41 +0200
4 Subject: treewide: use uint* instead of u_int*
6 Gcc complains about missing types. Some commits introduced u_int* instead
7 of uint*. Use uint treewide.
9 Fixes errors in the form of:
10 In file included from xtables-legacy-multi.c:5:
11 xshared.h:83:56: error: unknown type name 'u_int16_t'; did you mean 'uint16_t'?
12 83 | set_option(unsigned int *options, unsigned int option, u_int16_t *invflg,
15 make[6]: *** [Makefile:712: xtables_legacy_multi-xtables-legacy-multi.o] Error 1
17 Avoid libipq API breakage by adjusting libipq.h include accordingly. For
18 arpt_mangle.h kernel uAPI header, apply same change as in kernel commit
19 e91ded8db5747 ("uapi: netfilter_arp: use __u8 instead of u_int8_t").
21 Signed-off-by: Nick Hainke <vincent@systemli.org>
22 Signed-off-by: Phil Sutter <phil@nwl.cc>
24 extensions/libxt_conntrack.c | 2 +-
25 include/libipq/libipq.h | 8 ++++----
26 include/libiptc/libxtc.h | 2 +-
27 include/linux/netfilter_arp/arpt_mangle.h | 2 +-
28 iptables/xshared.c | 2 +-
29 iptables/xshared.h | 2 +-
30 libipq/ipq_create_handle.3 | 2 +-
31 libipq/ipq_set_mode.3 | 2 +-
32 8 files changed, 11 insertions(+), 11 deletions(-)
34 --- a/extensions/libxt_conntrack.c
35 +++ b/extensions/libxt_conntrack.c
36 @@ -778,7 +778,7 @@ matchinfo_print(const void *ip, const st
39 conntrack_dump_ports(const char *prefix, const char *opt,
40 - u_int16_t port_low, u_int16_t port_high)
41 + uint16_t port_low, uint16_t port_high)
43 if (port_high == 0 || port_low == port_high)
44 printf(" %s%s %u", prefix, opt, port_low);
45 --- a/include/libipq/libipq.h
46 +++ b/include/libipq/libipq.h
51 -#include <sys/types.h>
53 #include <sys/socket.h>
55 #include <asm/types.h>
56 @@ -48,19 +48,19 @@ typedef unsigned long ipq_id_t;
62 struct sockaddr_nl local;
63 struct sockaddr_nl peer;
66 -struct ipq_handle *ipq_create_handle(u_int32_t flags, u_int32_t protocol);
67 +struct ipq_handle *ipq_create_handle(uint32_t flags, uint32_t protocol);
69 int ipq_destroy_handle(struct ipq_handle *h);
71 ssize_t ipq_read(const struct ipq_handle *h,
72 unsigned char *buf, size_t len, int timeout);
74 -int ipq_set_mode(const struct ipq_handle *h, u_int8_t mode, size_t len);
75 +int ipq_set_mode(const struct ipq_handle *h, uint8_t mode, size_t len);
77 ipq_packet_msg_t *ipq_get_packet(const unsigned char *buf);
79 --- a/include/libiptc/libxtc.h
80 +++ b/include/libiptc/libxtc.h
81 @@ -10,7 +10,7 @@ extern "C" {
85 -/* xt_entry has pointers and u_int64_t's in it, so if you align to
86 +/* xt_entry has pointers and uint64_t's in it, so if you align to
87 it, you'll also align to any crazy matches and targets someone
89 #define XT_MIN_ALIGN (__alignof__(struct xt_entry))
90 --- a/include/linux/netfilter_arp/arpt_mangle.h
91 +++ b/include/linux/netfilter_arp/arpt_mangle.h
92 @@ -13,7 +13,7 @@ struct arpt_mangle
94 struct in_addr tgt_ip;
101 --- a/iptables/xshared.c
102 +++ b/iptables/xshared.c
103 @@ -1025,7 +1025,7 @@ static const int inverse_for_options[NUM
107 -set_option(unsigned int *options, unsigned int option, u_int16_t *invflg,
108 +set_option(unsigned int *options, unsigned int option, uint16_t *invflg,
111 if (*options & option)
112 --- a/iptables/xshared.h
113 +++ b/iptables/xshared.h
114 @@ -80,7 +80,7 @@ struct xtables_target;
115 #define IPT_INV_ARPHRD 0x0800
118 -set_option(unsigned int *options, unsigned int option, u_int16_t *invflg,
119 +set_option(unsigned int *options, unsigned int option, uint16_t *invflg,
123 --- a/libipq/ipq_create_handle.3
124 +++ b/libipq/ipq_create_handle.3
125 @@ -24,7 +24,7 @@ ipq_create_handle, ipq_destroy_handle \(
127 .B #include <libipq.h>
129 -.BI "struct ipq_handle *ipq_create_handle(u_int32_t " flags ", u_int32_t " protocol ");"
130 +.BI "struct ipq_handle *ipq_create_handle(uint32_t " flags ", uint32_t " protocol ");"
132 .BI "int ipq_destroy_handle(struct ipq_handle *" h );
134 --- a/libipq/ipq_set_mode.3
135 +++ b/libipq/ipq_set_mode.3
136 @@ -24,7 +24,7 @@ ipq_set_mode \(em set the ip_queue queui
138 .B #include <libipq.h>
140 -.BI "int ipq_set_mode(const struct ipq_handle *" h ", u_int8_t " mode ", size_t " range );
141 +.BI "int ipq_set_mode(const struct ipq_handle *" h ", uint8_t " mode ", size_t " range );