[netfilter-cvslog] r7074 - trunk/iptables
kaber at trash.net
kaber at trash.net
Wed Oct 17 10:48:58 CEST 2007
Author: kaber at trash.net
Date: 2007-10-17 10:48:58 +0200 (Wed, 17 Oct 2007)
New Revision: 7074
Modified:
trunk/iptables/ip6tables-restore.c
trunk/iptables/ip6tables.c
trunk/iptables/iptables-restore.c
trunk/iptables/iptables.c
Log:
Fix sscanf type errors
Modified: trunk/iptables/ip6tables-restore.c
===================================================================
--- trunk/iptables/ip6tables-restore.c 2007-10-16 08:49:31 UTC (rev 7073)
+++ trunk/iptables/ip6tables-restore.c 2007-10-17 08:48:58 UTC (rev 7074)
@@ -77,11 +77,15 @@
static int parse_counters(char *string, struct ip6t_counters *ctr)
{
- u_int64_t *pcnt, *bcnt;
+ unsigned long long pcnt, bcnt;
+ int ret;
- pcnt = &ctr->pcnt;
- bcnt = &ctr->bcnt;
- return (sscanf(string, "[%llu:%llu]", (unsigned long long *)pcnt, (unsigned long long *)bcnt) == 2);
+ ret = sscanf(string, "[%llu:%llu]",
+ (unsigned long long *)&pcnt,
+ (unsigned long long *)&bcnt);
+ ctr->pcnt = pcnt;
+ ctr->bcnt = bcnt;
+ return ret == 2;
}
/* global new argv and argc */
Modified: trunk/iptables/ip6tables.c
===================================================================
--- trunk/iptables/ip6tables.c 2007-10-16 08:49:31 UTC (rev 7073)
+++ trunk/iptables/ip6tables.c 2007-10-17 08:48:58 UTC (rev 7074)
@@ -1413,7 +1413,7 @@
const char *jumpto = "";
char *protocol = NULL;
int proto_used = 0;
- u_int64_t *cnt;
+ unsigned long long cnt;
memset(&fw, 0, sizeof(fw));
@@ -1728,18 +1728,18 @@
"-%c requires packet and byte counter",
opt2char(OPT_COUNTERS));
- cnt = &fw.counters.pcnt;
- if (sscanf(pcnt, "%llu", (unsigned long long *)cnt) != 1)
+ if (sscanf(pcnt, "%llu", (unsigned long long *)&cnt) != 1)
exit_error(PARAMETER_PROBLEM,
"-%c packet counter not numeric",
opt2char(OPT_COUNTERS));
+ fw.counters.pcnt = cnt;
- cnt = &fw.counters.bcnt;
- if (sscanf(bcnt, "%llu", (unsigned long long *)cnt) != 1)
+ if (sscanf(bcnt, "%llu", (unsigned long long *)&cnt) != 1)
exit_error(PARAMETER_PROBLEM,
"-%c byte counter not numeric",
opt2char(OPT_COUNTERS));
-
+ fw.counters.bcnt = cnt;
+
break;
Modified: trunk/iptables/iptables-restore.c
===================================================================
--- trunk/iptables/iptables-restore.c 2007-10-16 08:49:31 UTC (rev 7073)
+++ trunk/iptables/iptables-restore.c 2007-10-17 08:48:58 UTC (rev 7074)
@@ -74,11 +74,15 @@
static int parse_counters(char *string, struct ipt_counters *ctr)
{
- u_int64_t *pcnt, *bcnt;
+ unsigned long long pcnt, bcnt;
+ int ret;
- pcnt = &ctr->pcnt;
- bcnt = &ctr->bcnt;
- return (sscanf(string, "[%llu:%llu]", (unsigned long long *)pcnt, (unsigned long long *)bcnt) == 2);
+ ret = sscanf(string, "[%llu:%llu]",
+ (unsigned long long *)&pcnt,
+ (unsigned long long *)&bcnt);
+ ctr->pcnt = pcnt;
+ ctr->bcnt = bcnt;
+ return ret == 2;
}
/* global new argv and argc */
Modified: trunk/iptables/iptables.c
===================================================================
--- trunk/iptables/iptables.c 2007-10-16 08:49:31 UTC (rev 7073)
+++ trunk/iptables/iptables.c 2007-10-17 08:48:58 UTC (rev 7074)
@@ -1469,7 +1469,7 @@
const char *jumpto = "";
char *protocol = NULL;
int proto_used = 0;
- u_int64_t *cnt;
+ unsigned long long cnt;
memset(&fw, 0, sizeof(fw));
@@ -1794,18 +1794,17 @@
"-%c requires packet and byte counter",
opt2char(OPT_COUNTERS));
- cnt = &fw.counters.pcnt;
- if (sscanf(pcnt, "%llu", (unsigned long long *)cnt) != 1)
+ if (sscanf(pcnt, "%llu", (unsigned long long *)&cnt) != 1)
exit_error(PARAMETER_PROBLEM,
"-%c packet counter not numeric",
opt2char(OPT_COUNTERS));
+ fw.counters.pcnt = cnt;
- cnt = &fw.counters.bcnt;
- if (sscanf(bcnt, "%llu", (unsigned long long *)cnt) != 1)
+ if (sscanf(bcnt, "%llu", (unsigned long long *)&cnt) != 1)
exit_error(PARAMETER_PROBLEM,
"-%c byte counter not numeric",
opt2char(OPT_COUNTERS));
-
+ fw.counters.bcnt = cnt;
break;
More information about the netfilter-cvslog
mailing list