summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ebtables-restore.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ebtables-restore.c b/ebtables-restore.c
index 9433e5e..ea02960 100644
--- a/ebtables-restore.c
+++ b/ebtables-restore.c
@@ -75,7 +75,7 @@ int main(int argc_, char *argv_[])
} else if (table_nr == -1)
ebtrest_print_error("no table specified");
if (*cmdline == ':') {
- int policy;
+ int policy, chain_nr;
char *ch;
if (!(ch = strchr(cmdline, ' ')))
@@ -93,8 +93,10 @@ int main(int argc_, char *argv_[])
/* No need to check chain name for consistency, since
* we're supposed to be reading an automatically generated
* file. */
- if (ebt_get_chainnr(&replace[table_nr], cmdline+1) == -1)
+ if ((chain_nr = ebt_get_chainnr(&replace[table_nr], cmdline+1)) == -1)
ebt_new_chain(&replace[table_nr], cmdline+1, policy);
+ else
+ replace[table_nr].chains[chain_nr]->policy = policy;
continue;
}
argv[1] = cmdline;