Skip to content

Commit f1c7222

Browse files
Jan Engelhardtkaber
authored andcommitted
netfilter: xtables: use guarded types
We are supposed to use the kernel's own types in userspace exports. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
1 parent b880c1f commit f1c7222

File tree

7 files changed

+32
-32
lines changed

7 files changed

+32
-32
lines changed

include/linux/netfilter/xt_CT.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
#define XT_CT_NOTRACK 0x1
55

66
struct xt_ct_target_info {
7-
u_int16_t flags;
8-
u_int16_t zone;
9-
u_int32_t ct_events;
10-
u_int32_t exp_events;
11-
char helper[16];
7+
__u16 flags;
8+
__u16 zone;
9+
__u32 ct_events;
10+
__u32 exp_events;
11+
char helper[16];
1212

1313
/* Used internally by the kernel */
1414
struct nf_conn *ct __attribute__((aligned(8)));

include/linux/netfilter/xt_TCPOPTSTRIP.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
(((1U << (idx & 31)) & bmap[(idx) >> 5]) != 0)
88

99
struct xt_tcpoptstrip_target_info {
10-
u_int32_t strip_bmap[8];
10+
__u32 strip_bmap[8];
1111
};
1212

1313
#endif /* _XT_TCPOPTSTRIP_H */

include/linux/netfilter/xt_TPROXY.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
* redirection. We can get rid of that whenever we get support for
66
* mutliple targets in the same rule. */
77
struct xt_tproxy_target_info {
8-
u_int32_t mark_mask;
9-
u_int32_t mark_value;
8+
__u32 mark_mask;
9+
__u32 mark_value;
1010
__be32 laddr;
1111
__be16 lport;
1212
};
1313

1414
struct xt_tproxy_target_info_v1 {
15-
u_int32_t mark_mask;
16-
u_int32_t mark_value;
15+
__u32 mark_mask;
16+
__u32 mark_value;
1717
union nf_inet_addr laddr;
1818
__be16 lport;
1919
};

include/linux/netfilter/xt_cluster.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ enum xt_cluster_flags {
66
};
77

88
struct xt_cluster_match_info {
9-
u_int32_t total_nodes;
10-
u_int32_t node_mask;
11-
u_int32_t hash_seed;
12-
u_int32_t flags;
9+
__u32 total_nodes;
10+
__u32 node_mask;
11+
__u32 hash_seed;
12+
__u32 flags;
1313
};
1414

1515
#define XT_CLUSTER_NODES_MAX 32

include/linux/netfilter/xt_quota.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ enum xt_quota_flags {
99
struct xt_quota_priv;
1010

1111
struct xt_quota_info {
12-
u_int32_t flags;
13-
u_int32_t pad;
14-
aligned_u64 quota;
12+
__u32 flags;
13+
__u32 pad;
14+
aligned_u64 quota;
1515

1616
/* Used internally by the kernel */
1717
struct xt_quota_priv *master;

include/linux/netfilter/xt_time.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#define _XT_TIME_H 1
33

44
struct xt_time_info {
5-
u_int32_t date_start;
6-
u_int32_t date_stop;
7-
u_int32_t daytime_start;
8-
u_int32_t daytime_stop;
9-
u_int32_t monthdays_match;
10-
u_int8_t weekdays_match;
11-
u_int8_t flags;
5+
__u32 date_start;
6+
__u32 date_stop;
7+
__u32 daytime_start;
8+
__u32 daytime_stop;
9+
__u32 monthdays_match;
10+
__u8 weekdays_match;
11+
__u8 flags;
1212
};
1313

1414
enum {

include/linux/netfilter/xt_u32.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ enum xt_u32_ops {
99
};
1010

1111
struct xt_u32_location_element {
12-
u_int32_t number;
13-
u_int8_t nextop;
12+
__u32 number;
13+
__u8 nextop;
1414
};
1515

1616
struct xt_u32_value_element {
17-
u_int32_t min;
18-
u_int32_t max;
17+
__u32 min;
18+
__u32 max;
1919
};
2020

2121
/*
@@ -27,14 +27,14 @@ struct xt_u32_value_element {
2727
struct xt_u32_test {
2828
struct xt_u32_location_element location[XT_U32_MAXSIZE+1];
2929
struct xt_u32_value_element value[XT_U32_MAXSIZE+1];
30-
u_int8_t nnums;
31-
u_int8_t nvalues;
30+
__u8 nnums;
31+
__u8 nvalues;
3232
};
3333

3434
struct xt_u32 {
3535
struct xt_u32_test tests[XT_U32_MAXSIZE+1];
36-
u_int8_t ntests;
37-
u_int8_t invert;
36+
__u8 ntests;
37+
__u8 invert;
3838
};
3939

4040
#endif /* _XT_U32_H */

0 commit comments

Comments
 (0)