Commit 62fc8051 authored by Jan Engelhardt's avatar Jan Engelhardt

netfilter: xtables: deconstify struct xt_action_param for matches

In future, layer-3 matches will be an xt module of their own, and
need to set the fragoff and thoff fields. Adding more pointers would
needlessy increase memory requirements (esp. so for 64-bit, where
pointers are wider).
Signed-off-by: default avatarJan Engelhardt <jengelh@medozas.de>
parent 4b560b44
...@@ -288,7 +288,7 @@ struct xt_match { ...@@ -288,7 +288,7 @@ struct xt_match {
non-linear skb, using skb_header_pointer and non-linear skb, using skb_header_pointer and
skb_ip_make_writable. */ skb_ip_make_writable. */
bool (*match)(const struct sk_buff *skb, bool (*match)(const struct sk_buff *skb,
const struct xt_action_param *); struct xt_action_param *);
/* Called when user tries to insert an entry of this type. */ /* Called when user tries to insert an entry of this type. */
int (*checkentry)(const struct xt_mtchk_param *); int (*checkentry)(const struct xt_mtchk_param *);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/netfilter_bridge/ebt_802_3.h> #include <linux/netfilter_bridge/ebt_802_3.h>
static bool static bool
ebt_802_3_mt(const struct sk_buff *skb, const struct xt_action_param *par) ebt_802_3_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct ebt_802_3_info *info = par->matchinfo; const struct ebt_802_3_info *info = par->matchinfo;
const struct ebt_802_3_hdr *hdr = ebt_802_3_hdr(skb); const struct ebt_802_3_hdr *hdr = ebt_802_3_hdr(skb);
......
...@@ -129,7 +129,7 @@ static int get_ip_src(const struct sk_buff *skb, __be32 *addr) ...@@ -129,7 +129,7 @@ static int get_ip_src(const struct sk_buff *skb, __be32 *addr)
} }
static bool static bool
ebt_among_mt(const struct sk_buff *skb, const struct xt_action_param *par) ebt_among_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct ebt_among_info *info = par->matchinfo; const struct ebt_among_info *info = par->matchinfo;
const char *dmac, *smac; const char *dmac, *smac;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <linux/netfilter_bridge/ebt_arp.h> #include <linux/netfilter_bridge/ebt_arp.h>
static bool static bool
ebt_arp_mt(const struct sk_buff *skb, const struct xt_action_param *par) ebt_arp_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct ebt_arp_info *info = par->matchinfo; const struct ebt_arp_info *info = par->matchinfo;
const struct arphdr *ah; const struct arphdr *ah;
......
...@@ -25,7 +25,7 @@ struct tcpudphdr { ...@@ -25,7 +25,7 @@ struct tcpudphdr {
}; };
static bool static bool
ebt_ip_mt(const struct sk_buff *skb, const struct xt_action_param *par) ebt_ip_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct ebt_ip_info *info = par->matchinfo; const struct ebt_ip_info *info = par->matchinfo;
const struct iphdr *ih; const struct iphdr *ih;
......
...@@ -28,7 +28,7 @@ struct tcpudphdr { ...@@ -28,7 +28,7 @@ struct tcpudphdr {
}; };
static bool static bool
ebt_ip6_mt(const struct sk_buff *skb, const struct xt_action_param *par) ebt_ip6_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct ebt_ip6_info *info = par->matchinfo; const struct ebt_ip6_info *info = par->matchinfo;
const struct ipv6hdr *ih6; const struct ipv6hdr *ih6;
......
...@@ -32,7 +32,7 @@ static DEFINE_SPINLOCK(limit_lock); ...@@ -32,7 +32,7 @@ static DEFINE_SPINLOCK(limit_lock);
#define CREDITS_PER_JIFFY POW2_BELOW32(MAX_CPJ) #define CREDITS_PER_JIFFY POW2_BELOW32(MAX_CPJ)
static bool static bool
ebt_limit_mt(const struct sk_buff *skb, const struct xt_action_param *par) ebt_limit_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
struct ebt_limit_info *info = (void *)par->matchinfo; struct ebt_limit_info *info = (void *)par->matchinfo;
unsigned long now = jiffies; unsigned long now = jiffies;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/netfilter_bridge/ebt_mark_m.h> #include <linux/netfilter_bridge/ebt_mark_m.h>
static bool static bool
ebt_mark_mt(const struct sk_buff *skb, const struct xt_action_param *par) ebt_mark_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct ebt_mark_m_info *info = par->matchinfo; const struct ebt_mark_m_info *info = par->matchinfo;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/netfilter_bridge/ebt_pkttype.h> #include <linux/netfilter_bridge/ebt_pkttype.h>
static bool static bool
ebt_pkttype_mt(const struct sk_buff *skb, const struct xt_action_param *par) ebt_pkttype_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct ebt_pkttype_info *info = par->matchinfo; const struct ebt_pkttype_info *info = par->matchinfo;
......
...@@ -120,7 +120,7 @@ static bool ebt_filter_config(const struct ebt_stp_info *info, ...@@ -120,7 +120,7 @@ static bool ebt_filter_config(const struct ebt_stp_info *info,
} }
static bool static bool
ebt_stp_mt(const struct sk_buff *skb, const struct xt_action_param *par) ebt_stp_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct ebt_stp_info *info = par->matchinfo; const struct ebt_stp_info *info = par->matchinfo;
const struct stp_header *sp; const struct stp_header *sp;
......
...@@ -36,7 +36,7 @@ MODULE_LICENSE("GPL"); ...@@ -36,7 +36,7 @@ MODULE_LICENSE("GPL");
#define EXIT_ON_MISMATCH(_MATCH_,_MASK_) {if (!((info->_MATCH_ == _MATCH_)^!!(info->invflags & _MASK_))) return false; } #define EXIT_ON_MISMATCH(_MATCH_,_MASK_) {if (!((info->_MATCH_ == _MATCH_)^!!(info->invflags & _MASK_))) return false; }
static bool static bool
ebt_vlan_mt(const struct sk_buff *skb, const struct xt_action_param *par) ebt_vlan_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct ebt_vlan_info *info = par->matchinfo; const struct ebt_vlan_info *info = par->matchinfo;
const struct vlan_hdr *fp; const struct vlan_hdr *fp;
......
...@@ -2138,7 +2138,7 @@ icmp_type_code_match(u_int8_t test_type, u_int8_t min_code, u_int8_t max_code, ...@@ -2138,7 +2138,7 @@ icmp_type_code_match(u_int8_t test_type, u_int8_t min_code, u_int8_t max_code,
} }
static bool static bool
icmp_match(const struct sk_buff *skb, const struct xt_action_param *par) icmp_match(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct icmphdr *ic; const struct icmphdr *ic;
struct icmphdr _icmph; struct icmphdr _icmph;
......
...@@ -30,7 +30,7 @@ static inline bool match_type(struct net *net, const struct net_device *dev, ...@@ -30,7 +30,7 @@ static inline bool match_type(struct net *net, const struct net_device *dev,
} }
static bool static bool
addrtype_mt_v0(const struct sk_buff *skb, const struct xt_action_param *par) addrtype_mt_v0(const struct sk_buff *skb, struct xt_action_param *par)
{ {
struct net *net = dev_net(par->in ? par->in : par->out); struct net *net = dev_net(par->in ? par->in : par->out);
const struct ipt_addrtype_info *info = par->matchinfo; const struct ipt_addrtype_info *info = par->matchinfo;
...@@ -48,7 +48,7 @@ addrtype_mt_v0(const struct sk_buff *skb, const struct xt_action_param *par) ...@@ -48,7 +48,7 @@ addrtype_mt_v0(const struct sk_buff *skb, const struct xt_action_param *par)
} }
static bool static bool
addrtype_mt_v1(const struct sk_buff *skb, const struct xt_action_param *par) addrtype_mt_v1(const struct sk_buff *skb, struct xt_action_param *par)
{ {
struct net *net = dev_net(par->in ? par->in : par->out); struct net *net = dev_net(par->in ? par->in : par->out);
const struct ipt_addrtype_info_v1 *info = par->matchinfo; const struct ipt_addrtype_info_v1 *info = par->matchinfo;
......
...@@ -30,7 +30,7 @@ spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert) ...@@ -30,7 +30,7 @@ spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
return r; return r;
} }
static bool ah_mt(const struct sk_buff *skb, const struct xt_action_param *par) static bool ah_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
struct ip_auth_hdr _ahdr; struct ip_auth_hdr _ahdr;
const struct ip_auth_hdr *ah; const struct ip_auth_hdr *ah;
......
...@@ -67,8 +67,7 @@ static inline bool match_tcp(const struct sk_buff *skb, ...@@ -67,8 +67,7 @@ static inline bool match_tcp(const struct sk_buff *skb,
return true; return true;
} }
static bool ecn_mt(const struct sk_buff *skb, static bool ecn_mt(const struct sk_buff *skb, struct xt_action_param *par)
const struct xt_action_param *par)
{ {
const struct ipt_ecn_info *info = par->matchinfo; const struct ipt_ecn_info *info = par->matchinfo;
......
...@@ -2154,7 +2154,7 @@ icmp6_type_code_match(u_int8_t test_type, u_int8_t min_code, u_int8_t max_code, ...@@ -2154,7 +2154,7 @@ icmp6_type_code_match(u_int8_t test_type, u_int8_t min_code, u_int8_t max_code,
} }
static bool static bool
icmp6_match(const struct sk_buff *skb, const struct xt_action_param *par) icmp6_match(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct icmp6hdr *ic; const struct icmp6hdr *ic;
struct icmp6hdr _icmph; struct icmp6hdr _icmph;
......
...@@ -36,8 +36,7 @@ spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert) ...@@ -36,8 +36,7 @@ spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
return r; return r;
} }
static bool ah_mt6(const struct sk_buff *skb, static bool ah_mt6(const struct sk_buff *skb, struct xt_action_param *par)
const struct xt_action_param *par)
{ {
struct ip_auth_hdr _ah; struct ip_auth_hdr _ah;
const struct ip_auth_hdr *ah; const struct ip_auth_hdr *ah;
......
...@@ -20,7 +20,7 @@ MODULE_LICENSE("GPL"); ...@@ -20,7 +20,7 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>"); MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>");
static bool static bool
eui64_mt6(const struct sk_buff *skb, const struct xt_action_param *par) eui64_mt6(const struct sk_buff *skb, struct xt_action_param *par)
{ {
unsigned char eui64[8]; unsigned char eui64[8];
......
...@@ -35,7 +35,7 @@ id_match(u_int32_t min, u_int32_t max, u_int32_t id, bool invert) ...@@ -35,7 +35,7 @@ id_match(u_int32_t min, u_int32_t max, u_int32_t id, bool invert)
} }
static bool static bool
frag_mt6(const struct sk_buff *skb, const struct xt_action_param *par) frag_mt6(const struct sk_buff *skb, struct xt_action_param *par)
{ {
struct frag_hdr _frag; struct frag_hdr _frag;
const struct frag_hdr *fh; const struct frag_hdr *fh;
......
...@@ -44,7 +44,7 @@ MODULE_ALIAS("ip6t_dst"); ...@@ -44,7 +44,7 @@ MODULE_ALIAS("ip6t_dst");
static struct xt_match hbh_mt6_reg[] __read_mostly; static struct xt_match hbh_mt6_reg[] __read_mostly;
static bool static bool
hbh_mt6(const struct sk_buff *skb, const struct xt_action_param *par) hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)
{ {
struct ipv6_opt_hdr _optsh; struct ipv6_opt_hdr _optsh;
const struct ipv6_opt_hdr *oh; const struct ipv6_opt_hdr *oh;
......
...@@ -27,7 +27,7 @@ MODULE_DESCRIPTION("Xtables: IPv6 header types match"); ...@@ -27,7 +27,7 @@ MODULE_DESCRIPTION("Xtables: IPv6 header types match");
MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>"); MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>");
static bool static bool
ipv6header_mt6(const struct sk_buff *skb, const struct xt_action_param *par) ipv6header_mt6(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct ip6t_ipv6header_info *info = par->matchinfo; const struct ip6t_ipv6header_info *info = par->matchinfo;
unsigned int temp; unsigned int temp;
......
...@@ -32,8 +32,7 @@ type_match(u_int8_t min, u_int8_t max, u_int8_t type, bool invert) ...@@ -32,8 +32,7 @@ type_match(u_int8_t min, u_int8_t max, u_int8_t type, bool invert)
return (type >= min && type <= max) ^ invert; return (type >= min && type <= max) ^ invert;
} }
static bool mh_mt6(const struct sk_buff *skb, static bool mh_mt6(const struct sk_buff *skb, struct xt_action_param *par)
const struct xt_action_param *par)
{ {
struct ip6_mh _mh; struct ip6_mh _mh;
const struct ip6_mh *mh; const struct ip6_mh *mh;
......
...@@ -36,8 +36,7 @@ segsleft_match(u_int32_t min, u_int32_t max, u_int32_t id, bool invert) ...@@ -36,8 +36,7 @@ segsleft_match(u_int32_t min, u_int32_t max, u_int32_t id, bool invert)
return r; return r;
} }
static bool rt_mt6(const struct sk_buff *skb, static bool rt_mt6(const struct sk_buff *skb, struct xt_action_param *par)
const struct xt_action_param *par)
{ {
struct ipv6_rt_hdr _route; struct ipv6_rt_hdr _route;
const struct ipv6_rt_hdr *rh; const struct ipv6_rt_hdr *rh;
......
...@@ -86,7 +86,7 @@ xt_cluster_is_multicast_addr(const struct sk_buff *skb, u_int8_t family) ...@@ -86,7 +86,7 @@ xt_cluster_is_multicast_addr(const struct sk_buff *skb, u_int8_t family)
} }
static bool static bool
xt_cluster_mt(const struct sk_buff *skb, const struct xt_action_param *par) xt_cluster_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
struct sk_buff *pskb = (struct sk_buff *)skb; struct sk_buff *pskb = (struct sk_buff *)skb;
const struct xt_cluster_match_info *info = par->matchinfo; const struct xt_cluster_match_info *info = par->matchinfo;
......
...@@ -16,7 +16,7 @@ MODULE_ALIAS("ipt_comment"); ...@@ -16,7 +16,7 @@ MODULE_ALIAS("ipt_comment");
MODULE_ALIAS("ip6t_comment"); MODULE_ALIAS("ip6t_comment");
static bool static bool
comment_mt(const struct sk_buff *skb, const struct xt_action_param *par) comment_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
/* We always match */ /* We always match */
return true; return true;
......
...@@ -18,7 +18,7 @@ MODULE_ALIAS("ipt_connbytes"); ...@@ -18,7 +18,7 @@ MODULE_ALIAS("ipt_connbytes");
MODULE_ALIAS("ip6t_connbytes"); MODULE_ALIAS("ip6t_connbytes");
static bool static bool
connbytes_mt(const struct sk_buff *skb, const struct xt_action_param *par) connbytes_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_connbytes_info *sinfo = par->matchinfo; const struct xt_connbytes_info *sinfo = par->matchinfo;
const struct nf_conn *ct; const struct nf_conn *ct;
......
...@@ -173,7 +173,7 @@ static int count_them(struct net *net, ...@@ -173,7 +173,7 @@ static int count_them(struct net *net,
} }
static bool static bool
connlimit_mt(const struct sk_buff *skb, const struct xt_action_param *par) connlimit_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
struct net *net = dev_net(par->in ? par->in : par->out); struct net *net = dev_net(par->in ? par->in : par->out);
const struct xt_connlimit_info *info = par->matchinfo; const struct xt_connlimit_info *info = par->matchinfo;
......
...@@ -91,7 +91,7 @@ static void connmark_tg_destroy(const struct xt_tgdtor_param *par) ...@@ -91,7 +91,7 @@ static void connmark_tg_destroy(const struct xt_tgdtor_param *par)
} }
static bool static bool
connmark_mt(const struct sk_buff *skb, const struct xt_action_param *par) connmark_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_connmark_mtinfo1 *info = par->matchinfo; const struct xt_connmark_mtinfo1 *info = par->matchinfo;
enum ip_conntrack_info ctinfo; enum ip_conntrack_info ctinfo;
......
...@@ -113,7 +113,7 @@ ct_proto_port_check(const struct xt_conntrack_mtinfo2 *info, ...@@ -113,7 +113,7 @@ ct_proto_port_check(const struct xt_conntrack_mtinfo2 *info,
} }
static bool static bool
conntrack_mt(const struct sk_buff *skb, const struct xt_action_param *par, conntrack_mt(const struct sk_buff *skb, struct xt_action_param *par,
u16 state_mask, u16 status_mask) u16 state_mask, u16 status_mask)
{ {
const struct xt_conntrack_mtinfo2 *info = par->matchinfo; const struct xt_conntrack_mtinfo2 *info = par->matchinfo;
...@@ -191,7 +191,7 @@ conntrack_mt(const struct sk_buff *skb, const struct xt_action_param *par, ...@@ -191,7 +191,7 @@ conntrack_mt(const struct sk_buff *skb, const struct xt_action_param *par,
} }
static bool static bool
conntrack_mt_v1(const struct sk_buff *skb, const struct xt_action_param *par) conntrack_mt_v1(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_conntrack_mtinfo1 *info = par->matchinfo; const struct xt_conntrack_mtinfo1 *info = par->matchinfo;
...@@ -199,7 +199,7 @@ conntrack_mt_v1(const struct sk_buff *skb, const struct xt_action_param *par) ...@@ -199,7 +199,7 @@ conntrack_mt_v1(const struct sk_buff *skb, const struct xt_action_param *par)
} }
static bool static bool
conntrack_mt_v2(const struct sk_buff *skb, const struct xt_action_param *par) conntrack_mt_v2(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_conntrack_mtinfo2 *info = par->matchinfo; const struct xt_conntrack_mtinfo2 *info = par->matchinfo;
......
...@@ -96,7 +96,7 @@ match_option(u_int8_t option, const struct sk_buff *skb, unsigned int protoff, ...@@ -96,7 +96,7 @@ match_option(u_int8_t option, const struct sk_buff *skb, unsigned int protoff,
} }
static bool static bool
dccp_mt(const struct sk_buff *skb, const struct xt_action_param *par) dccp_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_dccp_info *info = par->matchinfo; const struct xt_dccp_info *info = par->matchinfo;
const struct dccp_hdr *dh; const struct dccp_hdr *dh;
......
...@@ -25,7 +25,7 @@ MODULE_ALIAS("ipt_tos"); ...@@ -25,7 +25,7 @@ MODULE_ALIAS("ipt_tos");
MODULE_ALIAS("ip6t_tos"); MODULE_ALIAS("ip6t_tos");
static bool static bool
dscp_mt(const struct sk_buff *skb, const struct xt_action_param *par) dscp_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_dscp_info *info = par->matchinfo; const struct xt_dscp_info *info = par->matchinfo;
u_int8_t dscp = ipv4_get_dsfield(ip_hdr(skb)) >> XT_DSCP_SHIFT; u_int8_t dscp = ipv4_get_dsfield(ip_hdr(skb)) >> XT_DSCP_SHIFT;
...@@ -34,7 +34,7 @@ dscp_mt(const struct sk_buff *skb, const struct xt_action_param *par) ...@@ -34,7 +34,7 @@ dscp_mt(const struct sk_buff *skb, const struct xt_action_param *par)
} }
static bool static bool
dscp_mt6(const struct sk_buff *skb, const struct xt_action_param *par) dscp_mt6(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_dscp_info *info = par->matchinfo; const struct xt_dscp_info *info = par->matchinfo;
u_int8_t dscp = ipv6_get_dsfield(ipv6_hdr(skb)) >> XT_DSCP_SHIFT; u_int8_t dscp = ipv6_get_dsfield(ipv6_hdr(skb)) >> XT_DSCP_SHIFT;
...@@ -54,8 +54,7 @@ static int dscp_mt_check(const struct xt_mtchk_param *par) ...@@ -54,8 +54,7 @@ static int dscp_mt_check(const struct xt_mtchk_param *par)
return 0; return 0;
} }
static bool tos_mt(const struct sk_buff *skb, static bool tos_mt(const struct sk_buff *skb, struct xt_action_param *par)
const struct xt_action_param *par)
{ {
const struct xt_tos_match_info *info = par->matchinfo; const struct xt_tos_match_info *info = par->matchinfo;
......
...@@ -36,8 +36,7 @@ spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert) ...@@ -36,8 +36,7 @@ spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
return r; return r;
} }
static bool esp_mt(const struct sk_buff *skb, static bool esp_mt(const struct sk_buff *skb, struct xt_action_param *par)
const struct xt_action_param *par)
{ {
const struct ip_esp_hdr *eh; const struct ip_esp_hdr *eh;
struct ip_esp_hdr _esp; struct ip_esp_hdr _esp;
......
...@@ -516,7 +516,7 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo, ...@@ -516,7 +516,7 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo,
} }
static bool static bool
hashlimit_mt(const struct sk_buff *skb, const struct xt_action_param *par) hashlimit_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_hashlimit_mtinfo1 *info = par->matchinfo; const struct xt_hashlimit_mtinfo1 *info = par->matchinfo;
struct xt_hashlimit_htable *hinfo = info->hinfo; struct xt_hashlimit_htable *hinfo = info->hinfo;
......
...@@ -24,7 +24,7 @@ MODULE_ALIAS("ip6t_helper"); ...@@ -24,7 +24,7 @@ MODULE_ALIAS("ip6t_helper");
static bool static bool
helper_mt(const struct sk_buff *skb, const struct xt_action_param *par) helper_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_helper_info *info = par->matchinfo; const struct xt_helper_info *info = par->matchinfo;
const struct nf_conn *ct; const struct nf_conn *ct;
......
...@@ -25,8 +25,7 @@ MODULE_LICENSE("GPL"); ...@@ -25,8 +25,7 @@ MODULE_LICENSE("GPL");
MODULE_ALIAS("ipt_ttl"); MODULE_ALIAS("ipt_ttl");
MODULE_ALIAS("ip6t_hl"); MODULE_ALIAS("ip6t_hl");
static bool ttl_mt(const struct sk_buff *skb, static bool ttl_mt(const struct sk_buff *skb, struct xt_action_param *par)
const struct xt_action_param *par)
{ {
const struct ipt_ttl_info *info = par->matchinfo; const struct ipt_ttl_info *info = par->matchinfo;
const u8 ttl = ip_hdr(skb)->ttl; const u8 ttl = ip_hdr(skb)->ttl;
...@@ -45,8 +44,7 @@ static bool ttl_mt(const struct sk_buff *skb, ...@@ -45,8 +44,7 @@ static bool ttl_mt(const struct sk_buff *skb,
return false; return false;
} }
static bool hl_mt6(const struct sk_buff *skb, static bool hl_mt6(const struct sk_buff *skb, struct xt_action_param *par)
const struct xt_action_param *par)
{ {
const struct ip6t_hl_info *info = par->matchinfo; const struct ip6t_hl_info *info = par->matchinfo;
const struct ipv6hdr *ip6h = ipv6_hdr(skb); const struct ipv6hdr *ip6h = ipv6_hdr(skb);
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <linux/netfilter/xt_iprange.h> #include <linux/netfilter/xt_iprange.h>
static bool static bool
iprange_mt4(const struct sk_buff *skb, const struct xt_action_param *par) iprange_mt4(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_iprange_mtinfo *info = par->matchinfo; const struct xt_iprange_mtinfo *info = par->matchinfo;
const struct iphdr *iph = ip_hdr(skb); const struct iphdr *iph = ip_hdr(skb);
...@@ -68,7 +68,7 @@ iprange_ipv6_sub(const struct in6_addr *a, const struct in6_addr *b) ...@@ -68,7 +68,7 @@ iprange_ipv6_sub(const struct in6_addr *a, const struct in6_addr *b)
} }
static bool static bool
iprange_mt6(const struct sk_buff *skb, const struct xt_action_param *par) iprange_mt6(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_iprange_mtinfo *info = par->matchinfo; const struct xt_iprange_mtinfo *info = par->matchinfo;
const struct ipv6hdr *iph = ipv6_hdr(skb); const struct ipv6hdr *iph = ipv6_hdr(skb);
......
...@@ -21,7 +21,7 @@ MODULE_ALIAS("ipt_length"); ...@@ -21,7 +21,7 @@ MODULE_ALIAS("ipt_length");
MODULE_ALIAS("ip6t_length"); MODULE_ALIAS("ip6t_length");
static bool static bool
length_mt(const struct sk_buff *skb, const struct xt_action_param *par) length_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_length_info *info = par->matchinfo; const struct xt_length_info *info = par->matchinfo;
u_int16_t pktlen = ntohs(ip_hdr(skb)->tot_len); u_int16_t pktlen = ntohs(ip_hdr(skb)->tot_len);
...@@ -30,7 +30,7 @@ length_mt(const struct sk_buff *skb, const struct xt_action_param *par) ...@@ -30,7 +30,7 @@ length_mt(const struct sk_buff *skb, const struct xt_action_param *par)
} }
static bool static bool
length_mt6(const struct sk_buff *skb, const struct xt_action_param *par) length_mt6(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_length_info *info = par->matchinfo; const struct xt_length_info *info = par->matchinfo;
const u_int16_t pktlen = ntohs(ipv6_hdr(skb)->payload_len) + const u_int16_t pktlen = ntohs(ipv6_hdr(skb)->payload_len) +
......
...@@ -65,7 +65,7 @@ static DEFINE_SPINLOCK(limit_lock); ...@@ -65,7 +65,7 @@ static DEFINE_SPINLOCK(limit_lock);
#define CREDITS_PER_JIFFY POW2_BELOW32(MAX_CPJ) #define CREDITS_PER_JIFFY POW2_BELOW32(MAX_CPJ)
static bool static bool
limit_mt(const struct sk_buff *skb, const struct xt_action_param *par) limit_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_rateinfo *r = par->matchinfo; const struct xt_rateinfo *r = par->matchinfo;
struct xt_limit_priv *priv = r->master; struct xt_limit_priv *priv = r->master;
......
...@@ -25,8 +25,7 @@ MODULE_DESCRIPTION("Xtables: MAC address match"); ...@@ -25,8 +25,7 @@ MODULE_DESCRIPTION("Xtables: MAC address match");
MODULE_ALIAS("ipt_mac"); MODULE_ALIAS("ipt_mac");
MODULE_ALIAS("ip6t_mac"); MODULE_ALIAS("ip6t_mac");
static bool mac_mt(const struct sk_buff *skb, static bool mac_mt(const struct sk_buff *skb, struct xt_action_param *par)
const struct xt_action_param *par)
{ {
const struct xt_mac_info *info = par->matchinfo; const struct xt_mac_info *info = par->matchinfo;
bool ret; bool ret;
......
...@@ -34,7 +34,7 @@ mark_tg(struct sk_buff *skb, const struct xt_action_param *par) ...@@ -34,7 +34,7 @@ mark_tg(struct sk_buff *skb, const struct xt_action_param *par)
} }
static bool static bool
mark_mt(const struct sk_buff *skb, const struct xt_action_param *par) mark_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_mark_mtinfo1 *info = par->matchinfo; const struct xt_mark_mtinfo1 *info = par->matchinfo;
......
...@@ -72,7 +72,7 @@ ports_match_v1(const struct xt_multiport_v1 *minfo, ...@@ -72,7 +72,7 @@ ports_match_v1(const struct xt_multiport_v1 *minfo,
} }
static bool static bool
multiport_mt(const struct sk_buff *skb, const struct xt_action_param *par) multiport_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const __be16 *pptr; const __be16 *pptr;
__be16 _ports[2]; __be16 _ports[2];
......
...@@ -194,7 +194,7 @@ static inline int xt_osf_ttl(const struct sk_buff *skb, const struct xt_osf_info ...@@ -194,7 +194,7 @@ static inline int xt_osf_ttl(const struct sk_buff *skb, const struct xt_osf_info
} }
static bool static bool
xt_osf_match_packet(const struct sk_buff *skb, const struct xt_action_param *p) xt_osf_match_packet(const struct sk_buff *skb, struct xt_action_param *p)
{ {
const struct xt_osf_info *info = p->matchinfo; const struct xt_osf_info *info = p->matchinfo;
const struct iphdr *ip = ip_hdr(skb); const struct iphdr *ip = ip_hdr(skb);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <linux/netfilter/xt_owner.h> #include <linux/netfilter/xt_owner.h>
static bool static bool
owner_mt(const struct sk_buff *skb, const struct xt_action_param *par) owner_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_owner_match_info *info = par->matchinfo; const struct xt_owner_match_info *info = par->matchinfo;
const struct file *filp; const struct file *filp;
......
...@@ -22,7 +22,7 @@ MODULE_ALIAS("ip6t_physdev"); ...@@ -22,7 +22,7 @@ MODULE_ALIAS("ip6t_physdev");
static bool static bool
physdev_mt(const struct sk_buff *skb, const struct xt_action_param *par) physdev_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
static const char nulldevname[IFNAMSIZ] __attribute__((aligned(sizeof(long)))); static const char nulldevname[IFNAMSIZ] __attribute__((aligned(sizeof(long))));
const struct xt_physdev_info *info = par->matchinfo; const struct xt_physdev_info *info = par->matchinfo;
......
...@@ -23,7 +23,7 @@ MODULE_ALIAS("ipt_pkttype"); ...@@ -23,7 +23,7 @@ MODULE_ALIAS("ipt_pkttype");
MODULE_ALIAS("ip6t_pkttype"); MODULE_ALIAS("ip6t_pkttype");
static bool static bool
pkttype_mt(const struct sk_buff *skb, const struct xt_action_param *par) pkttype_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_pkttype_info *info = par->matchinfo; const struct xt_pkttype_info *info = par->matchinfo;
u_int8_t type; u_int8_t type;
......
...@@ -110,7 +110,7 @@ match_policy_out(const struct sk_buff *skb, const struct xt_policy_info *info, ...@@ -110,7 +110,7 @@ match_policy_out(const struct sk_buff *skb, const struct xt_policy_info *info,
} }
static bool static bool
policy_mt(const struct sk_buff *skb, const struct xt_action_param *par) policy_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_policy_info *info = par->matchinfo; const struct xt_policy_info *info = par->matchinfo;
int ret; int ret;
......
...@@ -23,7 +23,7 @@ MODULE_ALIAS("ip6t_quota"); ...@@ -23,7 +23,7 @@ MODULE_ALIAS("ip6t_quota");
static DEFINE_SPINLOCK(quota_lock); static DEFINE_SPINLOCK(quota_lock);
static bool static bool
quota_mt(const struct sk_buff *skb, const struct xt_action_param *par) quota_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
struct xt_quota_info *q = (void *)par->matchinfo; struct xt_quota_info *q = (void *)par->matchinfo;
struct xt_quota_priv *priv = q->master; struct xt_quota_priv *priv = q->master;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
static bool static bool
xt_rateest_mt(const struct sk_buff *skb, const struct xt_action_param *par) xt_rateest_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_rateest_match_info *info = par->matchinfo; const struct xt_rateest_match_info *info = par->matchinfo;
struct gnet_stats_rate_est *r; struct gnet_stats_rate_est *r;
......
...@@ -22,7 +22,7 @@ MODULE_DESCRIPTION("Xtables: Routing realm match"); ...@@ -22,7 +22,7 @@ MODULE_DESCRIPTION("Xtables: Routing realm match");
MODULE_ALIAS("ipt_realm"); MODULE_ALIAS("ipt_realm");
static bool static bool
realm_mt(const struct sk_buff *skb, const struct xt_action_param *par) realm_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_realm_info *info = par->matchinfo; const struct xt_realm_info *info = par->matchinfo;
const struct dst_entry *dst = skb_dst(skb); const struct dst_entry *dst = skb_dst(skb);
......
...@@ -224,7 +224,7 @@ static void recent_table_flush(struct recent_table *t) ...@@ -224,7 +224,7 @@ static void recent_table_flush(struct recent_table *t)
} }
static bool static bool
recent_mt(const struct sk_buff *skb, const struct xt_action_param *par) recent_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
struct net *net = dev_net(par->in ? par->in : par->out); struct net *net = dev_net(par->in ? par->in : par->out);
struct recent_net *recent_net = recent_pernet(net); struct recent_net *recent_net = recent_pernet(net);
......
...@@ -114,7 +114,7 @@ match_packet(const struct sk_buff *skb, ...@@ -114,7 +114,7 @@ match_packet(const struct sk_buff *skb,
} }
static bool static bool
sctp_mt(const struct sk_buff *skb, const struct xt_action_param *par) sctp_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_sctp_info *info = par->matchinfo; const struct xt_sctp_info *info = par->matchinfo;
const sctp_sctphdr_t *sh; const sctp_sctphdr_t *sh;
......
...@@ -88,7 +88,7 @@ extract_icmp_fields(const struct sk_buff *skb, ...@@ -88,7 +88,7 @@ extract_icmp_fields(const struct sk_buff *skb,
static bool static bool
socket_match(const struct sk_buff *skb, const struct xt_action_param *par, socket_match(const struct sk_buff *skb, struct xt_action_param *par,
const struct xt_socket_mtinfo1 *info) const struct xt_socket_mtinfo1 *info)
{ {
const struct iphdr *iph = ip_hdr(skb); const struct iphdr *iph = ip_hdr(skb);
...@@ -174,13 +174,13 @@ socket_match(const struct sk_buff *skb, const struct xt_action_param *par, ...@@ -174,13 +174,13 @@ socket_match(const struct sk_buff *skb, const struct xt_action_param *par,
} }
static bool static bool
socket_mt_v0(const struct sk_buff *skb, const struct xt_action_param *par) socket_mt_v0(const struct sk_buff *skb, struct xt_action_param *par)
{ {
return socket_match(skb, par, NULL); return socket_match(skb, par, NULL);
} }
static bool static bool
socket_mt_v1(const struct sk_buff *skb, const struct xt_action_param *par) socket_mt_v1(const struct sk_buff *skb, struct xt_action_param *par)
{ {
return socket_match(skb, par, par->matchinfo); return socket_match(skb, par, par->matchinfo);
} }
......
...@@ -21,7 +21,7 @@ MODULE_ALIAS("ipt_state"); ...@@ -21,7 +21,7 @@ MODULE_ALIAS("ipt_state");
MODULE_ALIAS("ip6t_state"); MODULE_ALIAS("ip6t_state");
static bool static bool
state_mt(const struct sk_buff *skb, const struct xt_action_param *par) state_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_state_info *sinfo = par->matchinfo; const struct xt_state_info *sinfo = par->matchinfo;
enum ip_conntrack_info ctinfo; enum ip_conntrack_info ctinfo;
......
...@@ -30,7 +30,7 @@ MODULE_ALIAS("ip6t_statistic"); ...@@ -30,7 +30,7 @@ MODULE_ALIAS("ip6t_statistic");
static DEFINE_SPINLOCK(nth_lock); static DEFINE_SPINLOCK(nth_lock);
static bool static bool
statistic_mt(const struct sk_buff *skb, const struct xt_action_param *par) statistic_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_statistic_info *info = par->matchinfo; const struct xt_statistic_info *info = par->matchinfo;
bool ret = info->flags & XT_STATISTIC_INVERT; bool ret = info->flags & XT_STATISTIC_INVERT;
......
...@@ -23,7 +23,7 @@ MODULE_ALIAS("ipt_string"); ...@@ -23,7 +23,7 @@ MODULE_ALIAS("ipt_string");
MODULE_ALIAS("ip6t_string"); MODULE_ALIAS("ip6t_string");
static bool static bool
string_mt(const struct sk_buff *skb, const struct xt_action_param *par) string_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_string_info *conf = par->matchinfo; const struct xt_string_info *conf = par->matchinfo;
struct ts_state state; struct ts_state state;
......
...@@ -25,7 +25,7 @@ MODULE_ALIAS("ipt_tcpmss"); ...@@ -25,7 +25,7 @@ MODULE_ALIAS("ipt_tcpmss");
MODULE_ALIAS("ip6t_tcpmss"); MODULE_ALIAS("ip6t_tcpmss");
static bool static bool
tcpmss_mt(const struct sk_buff *skb, const struct xt_action_param *par) tcpmss_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_tcpmss_match_info *info = par->matchinfo; const struct xt_tcpmss_match_info *info = par->matchinfo;
const struct tcphdr *th; const struct tcphdr *th;
......
...@@ -62,8 +62,7 @@ tcp_find_option(u_int8_t option, ...@@ -62,8 +62,7 @@ tcp_find_option(u_int8_t option,
return invert; return invert;
} }
static bool tcp_mt(const struct sk_buff *skb, static bool tcp_mt(const struct sk_buff *skb, struct xt_action_param *par)
const struct xt_action_param *par)
{ {
const struct tcphdr *th; const struct tcphdr *th;
struct tcphdr _tcph; struct tcphdr _tcph;
...@@ -129,8 +128,7 @@ static int tcp_mt_check(const struct xt_mtchk_param *par) ...@@ -129,8 +128,7 @@ static int tcp_mt_check(const struct xt_mtchk_param *par)
return (tcpinfo->invflags & ~XT_TCP_INV_MASK) ? -EINVAL : 0; return (tcpinfo->invflags & ~XT_TCP_INV_MASK) ? -EINVAL : 0;
} }
static bool udp_mt(const struct sk_buff *skb, static bool udp_mt(const struct sk_buff *skb, struct xt_action_param *par)
const struct xt_action_param *par)
{ {
const struct udphdr *uh; const struct udphdr *uh;
struct udphdr _udph; struct udphdr _udph;
......
...@@ -152,7 +152,7 @@ static void localtime_3(struct xtm *r, time_t time) ...@@ -152,7 +152,7 @@ static void localtime_3(struct xtm *r, time_t time)
} }
static bool static bool
time_mt(const struct sk_buff *skb, const struct xt_action_param *par) time_mt(const struct sk_buff *skb, struct xt_action_param *par)
{ {
const struct xt_time_info *info = par->matchinfo; const struct xt_time_info *info = par->matchinfo;
unsigned int packet_time; unsigned int packet_time;
......
...@@ -86,8 +86,7 @@ static bool u32_match_it(const struct xt_u32 *data, ...@@ -86,8 +86,7 @@ static bool u32_match_it(const struct xt_u32 *data,
return true; return true;
} }
static bool u32_mt(const struct sk_buff *skb, static bool u32_mt(const struct sk_buff *skb, struct xt_action_param *par)
const struct xt_action_param *par)
{ {
const struct xt_u32 *data = par->matchinfo; const struct xt_u32 *data = par->matchinfo;
bool ret; bool ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment