Skip to content

Commit

Permalink
netfilter: xtables: use guarded types
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Engelhardt authored and Patrick McHardy committed Dec 15, 2010
1 parent b880c1f commit f1c7222
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
10 changes: 5 additions & 5 deletions include/linux/netfilter/xt_CT.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#define XT_CT_NOTRACK 0x1

struct xt_ct_target_info {
u_int16_t flags;
u_int16_t zone;
u_int32_t ct_events;
u_int32_t exp_events;
char helper[16];
__u16 flags;
__u16 zone;
__u32 ct_events;
__u32 exp_events;
char helper[16];

/* Used internally by the kernel */
struct nf_conn *ct __attribute__((aligned(8)));
Expand Down
2 changes: 1 addition & 1 deletion include/linux/netfilter/xt_TCPOPTSTRIP.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
(((1U << (idx & 31)) & bmap[(idx) >> 5]) != 0)

struct xt_tcpoptstrip_target_info {
u_int32_t strip_bmap[8];
__u32 strip_bmap[8];
};

#endif /* _XT_TCPOPTSTRIP_H */
8 changes: 4 additions & 4 deletions include/linux/netfilter/xt_TPROXY.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
* redirection. We can get rid of that whenever we get support for
* mutliple targets in the same rule. */
struct xt_tproxy_target_info {
u_int32_t mark_mask;
u_int32_t mark_value;
__u32 mark_mask;
__u32 mark_value;
__be32 laddr;
__be16 lport;
};

struct xt_tproxy_target_info_v1 {
u_int32_t mark_mask;
u_int32_t mark_value;
__u32 mark_mask;
__u32 mark_value;
union nf_inet_addr laddr;
__be16 lport;
};
Expand Down
8 changes: 4 additions & 4 deletions include/linux/netfilter/xt_cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ enum xt_cluster_flags {
};

struct xt_cluster_match_info {
u_int32_t total_nodes;
u_int32_t node_mask;
u_int32_t hash_seed;
u_int32_t flags;
__u32 total_nodes;
__u32 node_mask;
__u32 hash_seed;
__u32 flags;
};

#define XT_CLUSTER_NODES_MAX 32
Expand Down
6 changes: 3 additions & 3 deletions include/linux/netfilter/xt_quota.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ enum xt_quota_flags {
struct xt_quota_priv;

struct xt_quota_info {
u_int32_t flags;
u_int32_t pad;
aligned_u64 quota;
__u32 flags;
__u32 pad;
aligned_u64 quota;

/* Used internally by the kernel */
struct xt_quota_priv *master;
Expand Down
14 changes: 7 additions & 7 deletions include/linux/netfilter/xt_time.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
#define _XT_TIME_H 1

struct xt_time_info {
u_int32_t date_start;
u_int32_t date_stop;
u_int32_t daytime_start;
u_int32_t daytime_stop;
u_int32_t monthdays_match;
u_int8_t weekdays_match;
u_int8_t flags;
__u32 date_start;
__u32 date_stop;
__u32 daytime_start;
__u32 daytime_stop;
__u32 monthdays_match;
__u8 weekdays_match;
__u8 flags;
};

enum {
Expand Down
16 changes: 8 additions & 8 deletions include/linux/netfilter/xt_u32.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ enum xt_u32_ops {
};

struct xt_u32_location_element {
u_int32_t number;
u_int8_t nextop;
__u32 number;
__u8 nextop;
};

struct xt_u32_value_element {
u_int32_t min;
u_int32_t max;
__u32 min;
__u32 max;
};

/*
Expand All @@ -27,14 +27,14 @@ struct xt_u32_value_element {
struct xt_u32_test {
struct xt_u32_location_element location[XT_U32_MAXSIZE+1];
struct xt_u32_value_element value[XT_U32_MAXSIZE+1];
u_int8_t nnums;
u_int8_t nvalues;
__u8 nnums;
__u8 nvalues;
};

struct xt_u32 {
struct xt_u32_test tests[XT_U32_MAXSIZE+1];
u_int8_t ntests;
u_int8_t invert;
__u8 ntests;
__u8 invert;
};

#endif /* _XT_U32_H */

0 comments on commit f1c7222

Please sign in to comment.