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 diff --git a/extensions/libxt_conntrack.c b/extensions/libxt_conntrack.c
35 index 64018ce1..234085c5 100644
36 --- a/extensions/libxt_conntrack.c
37 +++ b/extensions/libxt_conntrack.c
38 @@ -778,7 +778,7 @@ matchinfo_print(const void *ip, const struct xt_entry_match *match, int numeric,
41 conntrack_dump_ports(const char *prefix, const char *opt,
42 - u_int16_t port_low, u_int16_t port_high)
43 + uint16_t port_low, uint16_t port_high)
45 if (port_high == 0 || port_low == port_high)
46 printf(" %s%s %u", prefix, opt, port_low);
47 diff --git a/include/libipq/libipq.h b/include/libipq/libipq.h
48 index 3cd13292..dd0cb205 100644
49 --- a/include/libipq/libipq.h
50 +++ b/include/libipq/libipq.h
55 -#include <sys/types.h>
57 #include <sys/socket.h>
59 #include <asm/types.h>
60 @@ -48,19 +48,19 @@ typedef unsigned long ipq_id_t;
66 struct sockaddr_nl local;
67 struct sockaddr_nl peer;
70 -struct ipq_handle *ipq_create_handle(u_int32_t flags, u_int32_t protocol);
71 +struct ipq_handle *ipq_create_handle(uint32_t flags, uint32_t protocol);
73 int ipq_destroy_handle(struct ipq_handle *h);
75 ssize_t ipq_read(const struct ipq_handle *h,
76 unsigned char *buf, size_t len, int timeout);
78 -int ipq_set_mode(const struct ipq_handle *h, u_int8_t mode, size_t len);
79 +int ipq_set_mode(const struct ipq_handle *h, uint8_t mode, size_t len);
81 ipq_packet_msg_t *ipq_get_packet(const unsigned char *buf);
83 diff --git a/include/libiptc/libxtc.h b/include/libiptc/libxtc.h
84 index 37010188..a1d16ef9 100644
85 --- a/include/libiptc/libxtc.h
86 +++ b/include/libiptc/libxtc.h
87 @@ -10,7 +10,7 @@ extern "C" {
91 -/* xt_entry has pointers and u_int64_t's in it, so if you align to
92 +/* xt_entry has pointers and uint64_t's in it, so if you align to
93 it, you'll also align to any crazy matches and targets someone
95 #define XT_MIN_ALIGN (__alignof__(struct xt_entry))
96 diff --git a/include/linux/netfilter_arp/arpt_mangle.h b/include/linux/netfilter_arp/arpt_mangle.h
97 index 250f5029..8c2b16a1 100644
98 --- a/include/linux/netfilter_arp/arpt_mangle.h
99 +++ b/include/linux/netfilter_arp/arpt_mangle.h
100 @@ -13,7 +13,7 @@ struct arpt_mangle
102 struct in_addr tgt_ip;
109 diff --git a/iptables/xshared.c b/iptables/xshared.c
110 index a8512d38..9b5e5b5b 100644
111 --- a/iptables/xshared.c
112 +++ b/iptables/xshared.c
113 @@ -1025,7 +1025,7 @@ static const int inverse_for_options[NUMBER_OF_OPT] =
117 -set_option(unsigned int *options, unsigned int option, u_int16_t *invflg,
118 +set_option(unsigned int *options, unsigned int option, uint16_t *invflg,
121 if (*options & option)
122 diff --git a/iptables/xshared.h b/iptables/xshared.h
123 index 14568bb0..f8212988 100644
124 --- a/iptables/xshared.h
125 +++ b/iptables/xshared.h
126 @@ -80,7 +80,7 @@ struct xtables_target;
127 #define IPT_INV_ARPHRD 0x0800
130 -set_option(unsigned int *options, unsigned int option, u_int16_t *invflg,
131 +set_option(unsigned int *options, unsigned int option, uint16_t *invflg,
135 diff --git a/libipq/ipq_create_handle.3 b/libipq/ipq_create_handle.3
136 index 11ef95c4..ebe46daa 100644
137 --- a/libipq/ipq_create_handle.3
138 +++ b/libipq/ipq_create_handle.3
139 @@ -24,7 +24,7 @@ ipq_create_handle, ipq_destroy_handle \(em create and destroy libipq handles.
141 .B #include <libipq.h>
143 -.BI "struct ipq_handle *ipq_create_handle(u_int32_t " flags ", u_int32_t " protocol ");"
144 +.BI "struct ipq_handle *ipq_create_handle(uint32_t " flags ", uint32_t " protocol ");"
146 .BI "int ipq_destroy_handle(struct ipq_handle *" h );
148 diff --git a/libipq/ipq_set_mode.3 b/libipq/ipq_set_mode.3
149 index 0edd3c00..e206886c 100644
150 --- a/libipq/ipq_set_mode.3
151 +++ b/libipq/ipq_set_mode.3
152 @@ -24,7 +24,7 @@ ipq_set_mode \(em set the ip_queue queuing mode
154 .B #include <libipq.h>
156 -.BI "int ipq_set_mode(const struct ipq_handle *" h ", u_int8_t " mode ", size_t " range );
157 +.BI "int ipq_set_mode(const struct ipq_handle *" h ", uint8_t " mode ", size_t " range );