Bug 745 - --set-counters does not work
Summary: --set-counters does not work
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: iptables (show other bugs)
Version: unstable
Hardware: all Linux
: P4 minor
Assignee: Nobody's working on this, feel free to take it
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-23 18:13 MSK by Marat Khairullin
Modified: 2003-08-25 15:18 MSD (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marat Khairullin 2002-03-23 18:13:41 MSK
Скорее всего ошибка в 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 Bug Reporter 2002-04-16 20:13:06 MSD
Fixed in 1.2.6a-alt1
Comment 2 Bug Reporter 2002-04-16 20:13:06 MSD
Fixed in 1.2.6a-alt1