]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Fix two more rulenumber off by 1 errors
authorMartin Josefsson <gandalf@wlug.westbo.se>
Wed, 22 Sep 2004 21:31:09 +0000 (21:31 +0000)
committerMartin Josefsson <gandalf@wlug.westbo.se>
Wed, 22 Sep 2004 21:31:09 +0000 (21:31 +0000)
libiptc/libiptc.c

index a71ecad1027d31bc0abaf5703d87688613a44692..3436da9e0bcc5256cf6a93f1e2af208d12166146 100644 (file)
@@ -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;
        }