aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-12-18 00:55:16 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:58:43 -0500
commit03dafbbdf8a5e8a9e3e347a393930ed49506d00b (patch)
tree2c6feea1eb987433e30a6e3adc913a845ca3a12e
parent06e1374a7ed45f1788353a2944a20133adc55649 (diff)
[NETFILTER]: arp_tables: remove obsolete standard_check function
The size check is already performed by xt_check_target, no need to do it again. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/netfilter/arp_tables.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index d5cae7e906cf..8b1842babafa 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -435,23 +435,6 @@ static int mark_source_chains(struct xt_table_info *newinfo,
435 return 1; 435 return 1;
436} 436}
437 437
438static inline int standard_check(const struct arpt_entry_target *t,
439 unsigned int max_offset)
440{
441 /* Check standard info. */
442 if (t->u.target_size
443 != ARPT_ALIGN(sizeof(struct arpt_standard_target))) {
444 duprintf("arpt_standard_check: target size %u != %Zu\n",
445 t->u.target_size,
446 ARPT_ALIGN(sizeof(struct arpt_standard_target)));
447 return 0;
448 }
449
450 return 1;
451}
452
453static struct arpt_target arpt_standard_target;
454
455static inline int check_entry(struct arpt_entry *e, const char *name, unsigned int size, 438static inline int check_entry(struct arpt_entry *e, const char *name, unsigned int size,
456 unsigned int *i) 439 unsigned int *i)
457{ 440{
@@ -486,14 +469,9 @@ static inline int check_entry(struct arpt_entry *e, const char *name, unsigned i
486 if (ret) 469 if (ret)
487 goto err; 470 goto err;
488 471
489 if (t->u.kernel.target == &arpt_standard_target) { 472 if (t->u.kernel.target->checkentry
490 if (!standard_check(t, size)) { 473 && !t->u.kernel.target->checkentry(name, e, target, t->data,
491 ret = -EINVAL; 474 e->comefrom)) {
492 goto err;
493 }
494 } else if (t->u.kernel.target->checkentry
495 && !t->u.kernel.target->checkentry(name, e, target, t->data,
496 e->comefrom)) {
497 duprintf("arp_tables: check failed for `%s'.\n", 475 duprintf("arp_tables: check failed for `%s'.\n",
498 t->u.kernel.target->name); 476 t->u.kernel.target->name);
499 ret = -EINVAL; 477 ret = -EINVAL;