Bug 745

Summary: --set-counters does not work
Product: Sisyphus Reporter: Marat Khairullin <xmm>
Component: iptablesAssignee: Nobody's working on this, feel free to take it <nobody>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P4 CC: glebfm, ldv, placeholder
Version: unstable   
Hardware: all   
OS: Linux   

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 @@
 					\&quot;-%c requires packet and byte counter\&quot;,
 					opt2char(OPT_COUNTERS));
 
-			if (sscanf(pcnt, \&quot;%llu\&quot;, &amp;fw.counters.pcnt) != 1)
+			if (sscanf(pcnt, \&quot;%Lu\&quot;, &amp;fw.counters.pcnt) != 1)
 				exit_error(PARAMETER_PROBLEM,
 					\&quot;-%c packet counter not numeric\&quot;,
 					opt2char(OPT_COUNTERS));
 
-			if (sscanf(bcnt, \&quot;%llu\&quot;, &amp;fw.counters.bcnt) != 1)
+			if (sscanf(bcnt, \&quot;%Lu\&quot;, &amp;fw.counters.bcnt) != 1)
 				exit_error(PARAMETER_PROBLEM,
 					\&quot;-%c byte counter not numeric\&quot;,
 					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