From: Martin Josefsson Date: Wed, 22 Sep 2004 21:31:09 +0000 (+0000) Subject: Fix two more rulenumber off by 1 errors X-Git-Tag: v1.3.0-rc1~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e795b0ad07174eed4172f8d7237b3abdd9d0e15;p=thirdparty%2Fiptables.git Fix two more rulenumber off by 1 errors --- diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index a71ecad1..3436da9e 100644 --- a/libiptc/libiptc.c +++ b/libiptc/libiptc.c @@ -1,4 +1,4 @@ -/* Library which manipulates firewall rules. Version $Revision: 1.52 $ */ +/* Library which manipulates firewall rules. Version $Revision: 1.53 $ */ /* Architecture of firewall rules is as follows: * @@ -1308,7 +1308,7 @@ TC_REPLACE_ENTRY(const IPT_CHAINLABEL chain, return 0; } - if (!(old = iptcc_get_rule_num(c, rulenum))) { + if (!(old = iptcc_get_rule_num(c, rulenum + 1))) { errno = E2BIG; return 0; } @@ -1495,7 +1495,7 @@ TC_DELETE_NUM_ENTRY(const IPT_CHAINLABEL chain, return 0; } - if (!(r = iptcc_get_rule_num(c, rulenum))) { + if (!(r = iptcc_get_rule_num(c, rulenum + 1))) { errno = E2BIG; return 0; }