Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41971
b: refs/heads/master
c: 1bc2326
h: refs/heads/master
i:
  41969: 4fccbbb
  41967: 1f52af8
v: v3
  • Loading branch information
Al Viro authored and David S. Miller committed Dec 3, 2006
1 parent 875c67b commit a3abbd6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f7da79d99863c044e28483e32c10b394bbd78d21
refs/heads/master: 1bc2326cbe24766d9cb236e63c091cbaecfa2f29
20 changes: 11 additions & 9 deletions trunk/net/bridge/netfilter/ebtables.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,17 +774,12 @@ static int check_chainloops(struct ebt_entries *chain, struct ebt_cl_stack *cl_s
}

/* do the parsing of the table/chains/entries/matches/watchers/targets, heh */
static int translate_table(struct ebt_replace *repl,
struct ebt_table_info *newinfo)
static int translate_table(char *name, struct ebt_table_info *newinfo)
{
unsigned int i, j, k, udc_cnt;
int ret;
struct ebt_cl_stack *cl_s = NULL; /* used in the checking for chain loops */

ret = ebt_verify_pointers(repl, newinfo);
if (ret != 0)
return ret;

i = 0;
while (i < NF_BR_NUMHOOKS && !newinfo->hook_entry[i])
i++;
Expand Down Expand Up @@ -889,7 +884,7 @@ static int translate_table(struct ebt_replace *repl,
/* used to know what we need to clean up if something goes wrong */
i = 0;
ret = EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
ebt_check_entry, newinfo, repl->name, &i, cl_s, udc_cnt);
ebt_check_entry, newinfo, name, &i, cl_s, udc_cnt);
if (ret != 0) {
EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
ebt_cleanup_entry, &i);
Expand Down Expand Up @@ -986,7 +981,11 @@ static int do_replace(void __user *user, unsigned int len)

/* this can get initialized by translate_table() */
newinfo->chainstack = NULL;
ret = translate_table(&tmp, newinfo);
ret = ebt_verify_pointers(&tmp, newinfo);
if (ret != 0)
goto free_counterstmp;

ret = translate_table(tmp.name, newinfo);

if (ret != 0)
goto free_counterstmp;
Expand Down Expand Up @@ -1185,7 +1184,10 @@ int ebt_register_table(struct ebt_table *table)

/* fill in newinfo and parse the entries */
newinfo->chainstack = NULL;
ret = translate_table(table->table, newinfo);
ret = ebt_verify_pointers(table->table, newinfo);
if (ret != 0)
goto free_chainstack;
ret = translate_table(table->table->name, newinfo);
if (ret != 0) {
BUGPRINT("Translate_table failed\n");
goto free_chainstack;
Expand Down

0 comments on commit a3abbd6

Please sign in to comment.