Bug 745 - --set-counters does not work
: --set-counters does not work
Status: CLOSED FIXED
: Sisyphus
(All bugs in Sisyphus/iptables)
: unstable
: all Linux
: P4 minor
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2002-03-23 18:13 by
Modified: 2003-08-25 15:18 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2002-03-23 18:13:41
Скорее всего ошибка в sscanf, но здесь решить быстрее...
(Хотя там тоже надо)
iptables-1.2.5-alt2
glibc-2.2.5-alt1

# iptables -t filter --set-counters 71 23181 -A INPUT -p tcp -m tcp --sport 80
-j ACCEPT
iptables v1.2.5: -c packet counter not numeric
Try `iptables -h\' or \'iptables --help\' for more information.

Та же ошибка в iptables-restore.
Решается с помощью патча:

--- iptables.c.old    Tue Mar  5 15:22:45 2002
+++ iptables.c    Sat Mar 23 00:40:52 2002
@@ -1989,12 +1989,12 @@
                     \"-%c requires packet and byte counter\",
                     opt2char(OPT_COUNTERS));

-            if (sscanf(pcnt, \"%llu\", &fw.counters.pcnt) != 1)
+            if (sscanf(pcnt, \"%Lu\", &fw.counters.pcnt) != 1)
                 exit_error(PARAMETER_PROBLEM,
                     \"-%c packet counter not numeric\",
                     opt2char(OPT_COUNTERS));

-            if (sscanf(bcnt, \"%llu\", &fw.counters.bcnt) != 1)
+            if (sscanf(bcnt, \"%Lu\", &fw.counters.bcnt) != 1)
                 exit_error(PARAMETER_PROBLEM,
                     \"-%c byte counter not numeric\",
                     opt2char(OPT_COUNTERS));
--- По манам параметры %ll и %L эквивалентны
+++ 

---

---
------- Comment #1 From 2002-04-16 20:13:06 -------
Fixed in 1.2.6a-alt1
------- Comment #2 From 2002-04-16 20:13:06 -------
Fixed in 1.2.6a-alt1