Skip to content

Commit

Permalink
[EBTABLES]: Clean ebt_get_udc_positions() up.
Browse files Browse the repository at this point in the history
Check for valid_hooks is redundant (newinfo->hook_entry[i] will
be NULL if bit i is not set).  Kill it, kill unused arguments.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Al Viro authored and David S. Miller committed Dec 3, 2006
1 parent 0e79553 commit 177abc3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions net/bridge/netfilter/ebtables.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,17 +533,14 @@ struct ebt_cl_stack
*/
static inline int
ebt_get_udc_positions(struct ebt_entry *e, struct ebt_table_info *newinfo,
struct ebt_entries **hook_entries, unsigned int *n, unsigned int valid_hooks,
struct ebt_cl_stack *udc)
unsigned int *n, struct ebt_cl_stack *udc)
{
int i;

/* we're only interested in chain starts */
if (e->bitmask)
return 0;
for (i = 0; i < NF_BR_NUMHOOKS; i++) {
if ((valid_hooks & (1 << i)) == 0)
continue;
if (newinfo->hook_entry[i] == (struct ebt_entries *)e)
break;
}
Expand Down Expand Up @@ -861,8 +858,7 @@ static int translate_table(struct ebt_replace *repl,
return -ENOMEM;
i = 0; /* the i'th udc */
EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
ebt_get_udc_positions, newinfo, repl->hook_entry, &i,
repl->valid_hooks, cl_s);
ebt_get_udc_positions, newinfo, &i, cl_s);
/* sanity check */
if (i != udc_cnt) {
BUGPRINT("i != udc_cnt\n");
Expand Down

0 comments on commit 177abc3

Please sign in to comment.