]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
treewide: use uint* instead of u_int*
authorNick Hainke <vincent@systemli.org>
Mon, 16 May 2022 16:16:41 +0000 (18:16 +0200)
committerPhil Sutter <phil@nwl.cc>
Wed, 18 May 2022 10:57:57 +0000 (12:57 +0200)
Gcc complains about missing types. Some commits introduced u_int* instead
of uint*. Use uint treewide.

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

Avoid libipq API breakage by adjusting libipq.h include accordingly. For
arpt_mangle.h kernel uAPI header, apply same change as in kernel commit
e91ded8db5747 ("uapi: netfilter_arp: use __u8 instead of u_int8_t").

Signed-off-by: Nick Hainke <vincent@systemli.org>
Signed-off-by: Phil Sutter <phil@nwl.cc>
extensions/libxt_conntrack.c
include/libipq/libipq.h
include/libiptc/libxtc.h
include/linux/netfilter_arp/arpt_mangle.h
iptables/xshared.c
iptables/xshared.h
libipq/ipq_create_handle.3
libipq/ipq_set_mode.3

index 64018ce152b7aa4120c19f014697e2935c8a1257..234085c5211c6428b4448fcf6a4023db325fa34f 100644 (file)
@@ -778,7 +778,7 @@ matchinfo_print(const void *ip, const struct xt_entry_match *match, int numeric,
 
 static void
 conntrack_dump_ports(const char *prefix, const char *opt,
-                    u_int16_t port_low, u_int16_t port_high)
+                    uint16_t port_low, uint16_t port_high)
 {
        if (port_high == 0 || port_low == port_high)
                printf(" %s%s %u", prefix, opt, port_low);
index 3cd1329217a00c48bfc4c8c978c8f94e8456d582..dd0cb205179cc23324527439608465c0abe25f49 100644 (file)
@@ -24,7 +24,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <sys/types.h>
+#include <stdint.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
 #include <asm/types.h>
@@ -48,19 +48,19 @@ typedef unsigned long ipq_id_t;
 struct ipq_handle
 {
        int fd;
-       u_int8_t blocking;
+       uint8_t blocking;
        struct sockaddr_nl local;
        struct sockaddr_nl peer;
 };
 
-struct ipq_handle *ipq_create_handle(u_int32_t flags, u_int32_t protocol);
+struct ipq_handle *ipq_create_handle(uint32_t flags, uint32_t protocol);
 
 int ipq_destroy_handle(struct ipq_handle *h);
 
 ssize_t ipq_read(const struct ipq_handle *h,
                 unsigned char *buf, size_t len, int timeout);
 
-int ipq_set_mode(const struct ipq_handle *h, u_int8_t mode, size_t len);
+int ipq_set_mode(const struct ipq_handle *h, uint8_t mode, size_t len);
 
 ipq_packet_msg_t *ipq_get_packet(const unsigned char *buf);
 
index 37010188b64fdcf30a2e4d1f240d88b3e8925b90..a1d16ef996d780e2918d938ea2cfd890cb9a0f1a 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
 #endif
 
 #ifndef XT_MIN_ALIGN
-/* xt_entry has pointers and u_int64_t's in it, so if you align to
+/* xt_entry has pointers and uint64_t's in it, so if you align to
    it, you'll also align to any crazy matches and targets someone
    might write */
 #define XT_MIN_ALIGN (__alignof__(struct xt_entry))
index 250f502902bb8e6178ea89d1792471f04a8f93c6..8c2b16a1f5a0b3c02dfbb754b0aed1b96f866758 100644 (file)
@@ -13,7 +13,7 @@ struct arpt_mangle
        union {
                struct in_addr tgt_ip;
        } u_t;
-       u_int8_t flags;
+       __u8 flags;
        int target;
 };
 
index a8512d3808154c717f76cff42e9eca5abe094d07..9b5e5b5bddc27a22686b288664d3e00a50954ad8 100644 (file)
@@ -1025,7 +1025,7 @@ static const int inverse_for_options[NUMBER_OF_OPT] =
 };
 
 void
-set_option(unsigned int *options, unsigned int option, u_int16_t *invflg,
+set_option(unsigned int *options, unsigned int option, uint16_t *invflg,
           bool invert)
 {
        if (*options & option)
index 14568bb00fb6510cdadb79ba0b9fa49a39ec4522..f821298839687ed4dcbf85673e039705841390e4 100644 (file)
@@ -80,7 +80,7 @@ struct xtables_target;
 #define IPT_INV_ARPHRD         0x0800
 
 void
-set_option(unsigned int *options, unsigned int option, u_int16_t *invflg,
+set_option(unsigned int *options, unsigned int option, uint16_t *invflg,
           bool invert);
 
 /**
index 11ef95c4b79f40e2cb063a3ea5afebcb06008041..ebe46daab92da5efd59cc61c5b424a497e4d45fa 100644 (file)
@@ -24,7 +24,7 @@ ipq_create_handle, ipq_destroy_handle \(em create and destroy libipq handles.
 .br
 .B #include <libipq.h>
 .sp
-.BI "struct ipq_handle *ipq_create_handle(u_int32_t " flags ", u_int32_t " protocol ");"
+.BI "struct ipq_handle *ipq_create_handle(uint32_t " flags ", uint32_t " protocol ");"
 .br
 .BI "int ipq_destroy_handle(struct ipq_handle *" h );
 .SH DESCRIPTION
index 0edd3c00a84f9724dd122ecf4d96c74243c110c2..e206886c8c6267a243fc04e9da99214edaaffb55 100644 (file)
@@ -24,7 +24,7 @@ ipq_set_mode \(em set the ip_queue queuing mode
 .br
 .B #include <libipq.h>
 .sp
-.BI "int ipq_set_mode(const struct ipq_handle *" h ", u_int8_t " mode ", size_t " range );
+.BI "int ipq_set_mode(const struct ipq_handle *" h ", uint8_t " mode ", size_t " range );
 .SH DESCRIPTION
 The
 .B ipq_set_mode