From 24816d3c530007d62f72b37ffabc35277c090cd1 Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Sun, 11 Feb 2007 12:47:58 +0000 Subject: speedup checking for loops --- ebtables.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'ebtables.c') diff --git a/ebtables.c b/ebtables.c index 1b819cd..6de714f 100644 --- a/ebtables.c +++ b/ebtables.c @@ -1170,9 +1170,14 @@ check_extension: rule_nr--; rule_nr_end = rule_nr; - ebt_check_for_loops(replace); - if (ebt_errormsg[0] != '\0') - goto delete_the_rule; + /* a jump to a udc requires checking for loops */ + if (!strcmp(new_entry->t->u.name, EBT_STANDARD_TARGET) && + ((struct ebt_standard_target *)(new_entry->t))->verdict >= 0) { + /* FIXME: this can be done faster */ + ebt_check_for_loops(replace); + if (ebt_errormsg[0] != '\0') + goto delete_the_rule; + } /* Do the final_check(), for all entries. * This is needed when adding a rule that has a chain target */ -- cgit v1.2.3