[PATCH arptables 2/2] src: fix compilation warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



libarptc/libarptc.c: In function ‘dump_entry’:
libarptc/libarptc.c:137:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘__u64’ [-Wformat]
libarptc/libarptc.c:137:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘__u64’ [-Wformat]

Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 arptables.c         |    7 ++++---
 libarptc/libarptc.c |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arptables.c b/arptables.c
index 845e226..f820ffa 100644
--- a/arptables.c
+++ b/arptables.c
@@ -2164,16 +2164,17 @@ int do_command(int argc, char *argv[], char **table, arptc_handle_t *handle)
 					"-%c requires packet and byte counter",
 					opt2char(OPT_COUNTERS));
 
-			if (sscanf(pcnt, "%"PRIu64, &fw.counters.pcnt) != 1)
+			if (sscanf(pcnt, "%"PRIu64,
+				   (uint64_t *)&fw.counters.pcnt) != 1)
 				exit_error(PARAMETER_PROBLEM,
 					"-%c packet counter not numeric",
 					opt2char(OPT_COUNTERS));
 
-			if (sscanf(bcnt, "%"PRIu64, &fw.counters.bcnt) != 1)
+			if (sscanf(bcnt, "%"PRIu64,
+				   (uint64_t *)&fw.counters.bcnt) != 1)
 				exit_error(PARAMETER_PROBLEM,
 					"-%c byte counter not numeric",
 					opt2char(OPT_COUNTERS));
-			
 			break;
 
 
diff --git a/libarptc/libarptc.c b/libarptc/libarptc.c
index 2dcaaef..0025a75 100644
--- a/libarptc/libarptc.c
+++ b/libarptc/libarptc.c
@@ -134,7 +134,7 @@ dump_entry(STRUCT_ENTRY *e, const TC_HANDLE_T handle)
 	printf("Flags: %02X\n", e->arp.flags);
 	printf("Invflags: %02X\n", e->arp.invflags);
 	printf("Counters: %"PRIu64" packets, %"PRIu64" bytes\n",
-	       e->counters.pcnt, e->counters.bcnt);
+	       (uint64_t)e->counters.pcnt, (uint64_t)e->counters.bcnt);
 /*
 	printf("Cache: %08X ", e->nfcache);
 	if (e->nfcache & NFC_ALTERED) printf("ALTERED ");
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux