Skip to content

Commit

Permalink
[NETFILTER]: x_tables: remove unused size argument to check/destroy f…
Browse files Browse the repository at this point in the history
…unctions

The size is verified by x_tables and isn't needed by the modules anymore.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
kaber authored and David S. Miller committed Sep 22, 2006
1 parent fe1cb10 commit efa7416
Show file tree
Hide file tree
Showing 57 changed files with 26 additions and 106 deletions.
8 changes: 2 additions & 6 deletions include/linux/netfilter/x_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,10 @@ struct xt_match
const void *ip,
const struct xt_match *match,
void *matchinfo,
unsigned int matchinfosize,
unsigned int hook_mask);

/* Called when entry of this type deleted. */
void (*destroy)(const struct xt_match *match, void *matchinfo,
unsigned int matchinfosize);
void (*destroy)(const struct xt_match *match, void *matchinfo);

/* Called when userspace align differs from kernel space one */
int (*compat)(void *match, void **dstptr, int *size, int convert);
Expand Down Expand Up @@ -221,12 +219,10 @@ struct xt_target
const void *entry,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask);

/* Called when entry of this type deleted. */
void (*destroy)(const struct xt_target *target, void *targinfo,
unsigned int targinfosize);
void (*destroy)(const struct xt_target *target, void *targinfo);

/* Called when userspace align differs from kernel space one */
int (*compat)(void *target, void **dstptr, int *size, int convert);
Expand Down
5 changes: 1 addition & 4 deletions net/ipv4/netfilter/arp_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,6 @@ static inline int check_entry(struct arpt_entry *e, const char *name, unsigned i
}
} else if (t->u.kernel.target->checkentry
&& !t->u.kernel.target->checkentry(name, e, target, t->data,
t->u.target_size
- sizeof(*t),
e->comefrom)) {
duprintf("arp_tables: check failed for `%s'.\n",
t->u.kernel.target->name);
Expand Down Expand Up @@ -559,8 +557,7 @@ static inline int cleanup_entry(struct arpt_entry *e, unsigned int *i)

t = arpt_get_target(e);
if (t->u.kernel.target->destroy)
t->u.kernel.target->destroy(t->u.kernel.target, t->data,
t->u.target_size - sizeof(*t));
t->u.kernel.target->destroy(t->u.kernel.target, t->data);
module_put(t->u.kernel.target->me);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/arpt_mangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ target(struct sk_buff **pskb,

static int
checkentry(const char *tablename, const void *e, const struct xt_target *target,
void *targinfo, unsigned int targinfosize, unsigned int hook_mask)
void *targinfo, unsigned int hook_mask)
{
const struct arpt_mangle *mangle = targinfo;

Expand Down
2 changes: 0 additions & 2 deletions net/ipv4/netfilter/ip_nat_rule.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ static int ipt_snat_checkentry(const char *tablename,
const void *entry,
const struct ipt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
struct ip_nat_multi_range_compat *mr = targinfo;
Expand All @@ -189,7 +188,6 @@ static int ipt_dnat_checkentry(const char *tablename,
const void *entry,
const struct ipt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
struct ip_nat_multi_range_compat *mr = targinfo;
Expand Down
14 changes: 3 additions & 11 deletions net/ipv4/netfilter/ip_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,7 @@ cleanup_match(struct ipt_entry_match *m, unsigned int *i)
return 1;

if (m->u.kernel.match->destroy)
m->u.kernel.match->destroy(m->u.kernel.match, m->data,
m->u.match_size - sizeof(*m));
m->u.kernel.match->destroy(m->u.kernel.match, m->data);
module_put(m->u.kernel.match->me);
return 0;
}
Expand Down Expand Up @@ -518,7 +517,6 @@ check_match(struct ipt_entry_match *m,

if (m->u.kernel.match->checkentry
&& !m->u.kernel.match->checkentry(name, ip, match, m->data,
m->u.match_size - sizeof(*m),
hookmask)) {
duprintf("ip_tables: check failed for `%s'.\n",
m->u.kernel.match->name);
Expand Down Expand Up @@ -579,8 +577,6 @@ check_entry(struct ipt_entry *e, const char *name, unsigned int size,
}
} else if (t->u.kernel.target->checkentry
&& !t->u.kernel.target->checkentry(name, e, target, t->data,
t->u.target_size
- sizeof(*t),
e->comefrom)) {
duprintf("ip_tables: check failed for `%s'.\n",
t->u.kernel.target->name);
Expand Down Expand Up @@ -652,8 +648,7 @@ cleanup_entry(struct ipt_entry *e, unsigned int *i)
IPT_MATCH_ITERATE(e, cleanup_match, NULL);
t = ipt_get_target(e);
if (t->u.kernel.target->destroy)
t->u.kernel.target->destroy(t->u.kernel.target, t->data,
t->u.target_size - sizeof(*t));
t->u.kernel.target->destroy(t->u.kernel.target, t->data);
module_put(t->u.kernel.target->me);
return 0;
}
Expand Down Expand Up @@ -1599,7 +1594,6 @@ static inline int compat_copy_match_from_user(struct ipt_entry_match *m,

if (m->u.kernel.match->checkentry
&& !m->u.kernel.match->checkentry(name, ip, match, dm->data,
dm->u.match_size - sizeof(*dm),
hookmask)) {
duprintf("ip_tables: check failed for `%s'.\n",
m->u.kernel.match->name);
Expand Down Expand Up @@ -1658,8 +1652,7 @@ static int compat_copy_entry_from_user(struct ipt_entry *e, void **dstptr,
goto out;
} else if (t->u.kernel.target->checkentry
&& !t->u.kernel.target->checkentry(name, de, target,
t->data, t->u.target_size - sizeof(*t),
de->comefrom)) {
t->data, de->comefrom)) {
duprintf("ip_tables: compat: check failed for `%s'.\n",
t->u.kernel.target->name);
goto out;
Expand Down Expand Up @@ -2182,7 +2175,6 @@ icmp_checkentry(const char *tablename,
const void *info,
const struct xt_match *match,
void *matchinfo,
unsigned int matchsize,
unsigned int hook_mask)
{
const struct ipt_icmp *icmpinfo = matchinfo;
Expand Down
4 changes: 1 addition & 3 deletions net/ipv4/netfilter/ipt_CLUSTERIP.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ checkentry(const char *tablename,
const void *e_void,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
struct ipt_clusterip_tgt_info *cipinfo = targinfo;
Expand Down Expand Up @@ -449,8 +448,7 @@ checkentry(const char *tablename,
}

/* drop reference count of cluster config when rule is deleted */
static void destroy(const struct xt_target *target, void *targinfo,
unsigned int targinfosize)
static void destroy(const struct xt_target *target, void *targinfo)
{
struct ipt_clusterip_tgt_info *cipinfo = targinfo;

Expand Down
1 change: 0 additions & 1 deletion net/ipv4/netfilter/ipt_ECN.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ checkentry(const char *tablename,
const void *e_void,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
const struct ipt_ECN_info *einfo = (struct ipt_ECN_info *)targinfo;
Expand Down
1 change: 0 additions & 1 deletion net/ipv4/netfilter/ipt_LOG.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ static int ipt_log_checkentry(const char *tablename,
const void *e,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
const struct ipt_log_info *loginfo = targinfo;
Expand Down
1 change: 0 additions & 1 deletion net/ipv4/netfilter/ipt_MASQUERADE.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ masquerade_check(const char *tablename,
const void *e,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
const struct ip_nat_multi_range_compat *mr = targinfo;
Expand Down
1 change: 0 additions & 1 deletion net/ipv4/netfilter/ipt_NETMAP.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ check(const char *tablename,
const void *e,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
const struct ip_nat_multi_range_compat *mr = targinfo;
Expand Down
1 change: 0 additions & 1 deletion net/ipv4/netfilter/ipt_REDIRECT.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ redirect_check(const char *tablename,
const void *e,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
const struct ip_nat_multi_range_compat *mr = targinfo;
Expand Down
1 change: 0 additions & 1 deletion net/ipv4/netfilter/ipt_REJECT.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ static int check(const char *tablename,
const void *e_void,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
const struct ipt_reject_info *rejinfo = targinfo;
Expand Down
4 changes: 1 addition & 3 deletions net/ipv4/netfilter/ipt_SAME.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ same_check(const char *tablename,
const void *e,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
unsigned int count, countess, rangeip, index = 0;
Expand Down Expand Up @@ -116,8 +115,7 @@ same_check(const char *tablename,
}

static void
same_destroy(const struct xt_target *target, void *targinfo,
unsigned int targinfosize)
same_destroy(const struct xt_target *target, void *targinfo)
{
struct ipt_same_info *mr = targinfo;

Expand Down
1 change: 0 additions & 1 deletion net/ipv4/netfilter/ipt_TCPMSS.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ ipt_tcpmss_checkentry(const char *tablename,
const void *e_void,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
const struct ipt_tcpmss_info *tcpmssinfo = targinfo;
Expand Down
1 change: 0 additions & 1 deletion net/ipv4/netfilter/ipt_TOS.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ checkentry(const char *tablename,
const void *e_void,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
const u_int8_t tos = ((struct ipt_tos_target_info *)targinfo)->tos;
Expand Down
1 change: 0 additions & 1 deletion net/ipv4/netfilter/ipt_TTL.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ static int ipt_ttl_checkentry(const char *tablename,
const void *e,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
struct ipt_TTL_info *info = targinfo;
Expand Down
1 change: 0 additions & 1 deletion net/ipv4/netfilter/ipt_ULOG.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ static int ipt_ulog_checkentry(const char *tablename,
const void *e,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hookmask)
{
struct ipt_ulog_info *loginfo = (struct ipt_ulog_info *) targinfo;
Expand Down
1 change: 0 additions & 1 deletion net/ipv4/netfilter/ipt_ah.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ checkentry(const char *tablename,
const void *ip_void,
const struct xt_match *match,
void *matchinfo,
unsigned int matchinfosize,
unsigned int hook_mask)
{
const struct ipt_ah *ahinfo = matchinfo;
Expand Down
3 changes: 1 addition & 2 deletions net/ipv4/netfilter/ipt_ecn.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ static int match(const struct sk_buff *skb,

static int checkentry(const char *tablename, const void *ip_void,
const struct xt_match *match,
void *matchinfo, unsigned int matchsize,
unsigned int hook_mask)
void *matchinfo, unsigned int hook_mask)
{
const struct ipt_ecn_info *info = matchinfo;
const struct ipt_ip *ip = ip_void;
Expand Down
4 changes: 1 addition & 3 deletions net/ipv4/netfilter/ipt_hashlimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ hashlimit_checkentry(const char *tablename,
const void *inf,
const struct xt_match *match,
void *matchinfo,
unsigned int matchsize,
unsigned int hook_mask)
{
struct ipt_hashlimit_info *r = matchinfo;
Expand Down Expand Up @@ -529,8 +528,7 @@ hashlimit_checkentry(const char *tablename,
}

static void
hashlimit_destroy(const struct xt_match *match, void *matchinfo,
unsigned int matchsize)
hashlimit_destroy(const struct xt_match *match, void *matchinfo)
{
struct ipt_hashlimit_info *r = matchinfo;

Expand Down
1 change: 0 additions & 1 deletion net/ipv4/netfilter/ipt_owner.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ checkentry(const char *tablename,
const void *ip,
const struct xt_match *match,
void *matchinfo,
unsigned int matchsize,
unsigned int hook_mask)
{
const struct ipt_owner_info *info = matchinfo;
Expand Down
5 changes: 2 additions & 3 deletions net/ipv4/netfilter/ipt_recent.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ ipt_recent_match(const struct sk_buff *skb,
static int
ipt_recent_checkentry(const char *tablename, const void *ip,
const struct xt_match *match, void *matchinfo,
unsigned int matchsize, unsigned int hook_mask)
unsigned int hook_mask)
{
const struct ipt_recent_info *info = matchinfo;
struct recent_table *t;
Expand Down Expand Up @@ -294,8 +294,7 @@ ipt_recent_checkentry(const char *tablename, const void *ip,
}

static void
ipt_recent_destroy(const struct xt_match *match, void *matchinfo,
unsigned int matchsize)
ipt_recent_destroy(const struct xt_match *match, void *matchinfo)
{
const struct ipt_recent_info *info = matchinfo;
struct recent_table *t;
Expand Down
10 changes: 2 additions & 8 deletions net/ipv6/netfilter/ip6_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,7 @@ cleanup_match(struct ip6t_entry_match *m, unsigned int *i)
return 1;

if (m->u.kernel.match->destroy)
m->u.kernel.match->destroy(m->u.kernel.match, m->data,
m->u.match_size - sizeof(*m));
m->u.kernel.match->destroy(m->u.kernel.match, m->data);
module_put(m->u.kernel.match->me);
return 0;
}
Expand Down Expand Up @@ -558,7 +557,6 @@ check_match(struct ip6t_entry_match *m,

if (m->u.kernel.match->checkentry
&& !m->u.kernel.match->checkentry(name, ipv6, match, m->data,
m->u.match_size - sizeof(*m),
hookmask)) {
duprintf("ip_tables: check failed for `%s'.\n",
m->u.kernel.match->name);
Expand Down Expand Up @@ -619,8 +617,6 @@ check_entry(struct ip6t_entry *e, const char *name, unsigned int size,
}
} else if (t->u.kernel.target->checkentry
&& !t->u.kernel.target->checkentry(name, e, target, t->data,
t->u.target_size
- sizeof(*t),
e->comefrom)) {
duprintf("ip_tables: check failed for `%s'.\n",
t->u.kernel.target->name);
Expand Down Expand Up @@ -692,8 +688,7 @@ cleanup_entry(struct ip6t_entry *e, unsigned int *i)
IP6T_MATCH_ITERATE(e, cleanup_match, NULL);
t = ip6t_get_target(e);
if (t->u.kernel.target->destroy)
t->u.kernel.target->destroy(t->u.kernel.target, t->data,
t->u.target_size - sizeof(*t));
t->u.kernel.target->destroy(t->u.kernel.target, t->data);
module_put(t->u.kernel.target->me);
return 0;
}
Expand Down Expand Up @@ -1349,7 +1344,6 @@ icmp6_checkentry(const char *tablename,
const void *entry,
const struct xt_match *match,
void *matchinfo,
unsigned int matchsize,
unsigned int hook_mask)
{
const struct ip6t_icmp *icmpinfo = matchinfo;
Expand Down
1 change: 0 additions & 1 deletion net/ipv6/netfilter/ip6t_HL.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ static int ip6t_hl_checkentry(const char *tablename,
const void *entry,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
struct ip6t_HL_info *info = targinfo;
Expand Down
1 change: 0 additions & 1 deletion net/ipv6/netfilter/ip6t_LOG.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ static int ip6t_log_checkentry(const char *tablename,
const void *entry,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
const struct ip6t_log_info *loginfo = targinfo;
Expand Down
1 change: 0 additions & 1 deletion net/ipv6/netfilter/ip6t_REJECT.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ static int check(const char *tablename,
const void *entry,
const struct xt_target *target,
void *targinfo,
unsigned int targinfosize,
unsigned int hook_mask)
{
const struct ip6t_reject_info *rejinfo = targinfo;
Expand Down
1 change: 0 additions & 1 deletion net/ipv6/netfilter/ip6t_ah.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ checkentry(const char *tablename,
const void *entry,
const struct xt_match *match,
void *matchinfo,
unsigned int matchinfosize,
unsigned int hook_mask)
{
const struct ip6t_ah *ahinfo = matchinfo;
Expand Down
1 change: 0 additions & 1 deletion net/ipv6/netfilter/ip6t_dst.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ checkentry(const char *tablename,
const void *info,
const struct xt_match *match,
void *matchinfo,
unsigned int matchinfosize,
unsigned int hook_mask)
{
const struct ip6t_opts *optsinfo = matchinfo;
Expand Down
Loading

0 comments on commit efa7416

Please sign in to comment.