diff options
author | Bart De Schuymer <bdschuym@pandora.be> | 2003-05-22 20:53:12 +0000 |
---|---|---|
committer | Bart De Schuymer <bdschuym@pandora.be> | 2003-05-22 20:53:12 +0000 |
commit | 336f35ed0505ca24c477d85287fc1e7d03130cf4 (patch) | |
tree | 0f3241cf708a4f5a28a124a2bc35516475ca384c /ebtables.c | |
parent | bcd1f32916a37d3f63074d2a3129925e61e43e65 (diff) | |
download | ebtables-336f35ed0505ca24c477d85287fc1e7d03130cf4.tar.gz |
fix rule nr handling with -D
Diffstat (limited to 'ebtables.c')
-rw-r--r-- | ebtables.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1292,16 +1292,13 @@ static void delete_rule(int begin, int end) struct ebt_u_entry **u_e, *u_e2; struct ebt_u_entries *entries = to_chain(), *entries2; - if (begin < 0) { - if (begin < entries->nentries) - goto rule_error; + if (begin < 0) begin += entries->nentries + 1; - } if (end < 0) end += entries->nentries + 1; - if (begin > end) -rule_error: + if (begin <= 0 || begin > end || end > entries->nentries) print_error("Sorry, wrong rule numbers"); + if ((begin = check_rule_exists(begin)) == -1 || (end = check_rule_exists(end)) == -1) print_error("Sorry, rule does not exist"); |