Commit efa74165 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NETFILTER]: x_tables: remove unused size argument to check/destroy functions



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

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fe1cb108
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -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);
@@ -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);
+1 −4
Original line number Diff line number Diff line
@@ -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);
@@ -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;
}
+1 −1
Original line number Diff line number Diff line
@@ -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;

+0 −2
Original line number Diff line number Diff line
@@ -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;
@@ -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;
+3 −11
Original line number Diff line number Diff line
@@ -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;
}
@@ -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);
@@ -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);
@@ -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;
}
@@ -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);
@@ -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;
@@ -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;
Loading