diff options
-rw-r--r-- | net/bridge/netfilter/ebtables.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index 3e1bf716509a..ec7709b5c568 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c | |||
@@ -464,17 +464,14 @@ static int ebt_verify_pointers(struct ebt_replace *repl, | |||
464 | */ | 464 | */ |
465 | static inline int | 465 | static inline int |
466 | ebt_check_entry_size_and_hooks(struct ebt_entry *e, | 466 | ebt_check_entry_size_and_hooks(struct ebt_entry *e, |
467 | struct ebt_table_info *newinfo, char *base, | 467 | struct ebt_table_info *newinfo, |
468 | struct ebt_entries **hook_entries, unsigned int *n, unsigned int *cnt, | 468 | unsigned int *n, unsigned int *cnt, |
469 | unsigned int *totalcnt, unsigned int *udc_cnt, unsigned int valid_hooks) | 469 | unsigned int *totalcnt, unsigned int *udc_cnt) |
470 | { | 470 | { |
471 | unsigned int offset = (char *)e - newinfo->entries; | ||
472 | int i; | 471 | int i; |
473 | 472 | ||
474 | for (i = 0; i < NF_BR_NUMHOOKS; i++) { | 473 | for (i = 0; i < NF_BR_NUMHOOKS; i++) { |
475 | if ((valid_hooks & (1 << i)) == 0) | 474 | if ((void *)e == (void *)newinfo->hook_entry[i]) |
476 | continue; | ||
477 | if ((char *)hook_entries[i] == base + offset) | ||
478 | break; | 475 | break; |
479 | } | 476 | } |
480 | /* beginning of a new chain | 477 | /* beginning of a new chain |
@@ -821,9 +818,8 @@ static int translate_table(struct ebt_replace *repl, | |||
821 | newinfo->nentries afterwards */ | 818 | newinfo->nentries afterwards */ |
822 | udc_cnt = 0; /* will hold the nr. of user defined chains (udc) */ | 819 | udc_cnt = 0; /* will hold the nr. of user defined chains (udc) */ |
823 | ret = EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size, | 820 | ret = EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size, |
824 | ebt_check_entry_size_and_hooks, newinfo, repl->entries, | 821 | ebt_check_entry_size_and_hooks, newinfo, |
825 | repl->hook_entry, &i, &j, &k, | 822 | &i, &j, &k, &udc_cnt); |
826 | &udc_cnt, repl->valid_hooks); | ||
827 | 823 | ||
828 | if (ret != 0) | 824 | if (ret != 0) |
829 | return ret; | 825 | return ret; |