aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-12-18 00:47:32 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:58:30 -0500
commit73cd598df46a73d6f02063f2520df115a9b88aa5 (patch)
tree14b243381c30965f73f7b49de41888ff5642fba7 /include
parent30c08c41be75145b8850ea14b2d5ee4ee4b705d8 (diff)
[NETFILTER]: ip_tables: fix compat types
Use compat types and compat iterators when dealing with compat entries for clarity. This doesn't actually make a difference for ip_tables, but is needed for ip6_tables and arp_tables. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 1e0cfca7f354..45fcad91e67b 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -236,11 +236,6 @@ ipt_get_target(struct ipt_entry *e)
236#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \ 236#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
237 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args) 237 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
238 238
239/* fn returns 0 to continue iteration */
240#define IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \
241 XT_ENTRY_ITERATE_CONTINUE(struct ipt_entry, entries, size, n, fn, \
242 ## args)
243
244/* 239/*
245 * Main firewall chains definitions and global var's definitions. 240 * Main firewall chains definitions and global var's definitions.
246 */ 241 */
@@ -316,8 +311,28 @@ struct compat_ipt_entry
316 unsigned char elems[0]; 311 unsigned char elems[0];
317}; 312};
318 313
314/* Helper functions */
315static inline struct ipt_entry_target *
316compat_ipt_get_target(struct compat_ipt_entry *e)
317{
318 return (void *)e + e->target_offset;
319}
320
319#define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) 321#define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s)
320 322
323/* fn returns 0 to continue iteration */
324#define COMPAT_IPT_MATCH_ITERATE(e, fn, args...) \
325 XT_MATCH_ITERATE(struct compat_ipt_entry, e, fn, ## args)
326
327/* fn returns 0 to continue iteration */
328#define COMPAT_IPT_ENTRY_ITERATE(entries, size, fn, args...) \
329 XT_ENTRY_ITERATE(struct compat_ipt_entry, entries, size, fn, ## args)
330
331/* fn returns 0 to continue iteration */
332#define COMPAT_IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \
333 XT_ENTRY_ITERATE_CONTINUE(struct compat_ipt_entry, entries, size, n, \
334 fn, ## args)
335
321#endif /* CONFIG_COMPAT */ 336#endif /* CONFIG_COMPAT */
322#endif /*__KERNEL__*/ 337#endif /*__KERNEL__*/
323#endif /* _IPTABLES_H */ 338#endif /* _IPTABLES_H */