|
|
0890d3 |
From 633ad43b19b4e5e26fff16c339f9fdd5293c2ffc Mon Sep 17 00:00:00 2001
|
|
|
0890d3 |
From: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
0890d3 |
Date: Thu, 2 Apr 2015 10:33:18 +0200
|
|
|
0890d3 |
Subject: [PATCH] src: fix compilation warning
|
|
|
0890d3 |
MIME-Version: 1.0
|
|
|
0890d3 |
Content-Type: text/plain; charset=UTF-8
|
|
|
0890d3 |
Content-Transfer-Encoding: 8bit
|
|
|
0890d3 |
|
|
|
0890d3 |
libarptc/libarptc.c: In function ‘dump_entry’:
|
|
|
0890d3 |
libarptc/libarptc.c:137:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘__u64’ [-Wformat]
|
|
|
0890d3 |
libarptc/libarptc.c:137:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘__u64’ [-Wformat]
|
|
|
0890d3 |
|
|
|
0890d3 |
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
0890d3 |
(cherry picked from commit 935acea0326785834b22f2233e1b1e3f8d000f7d)
|
|
|
0890d3 |
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
|
|
0890d3 |
---
|
|
|
0890d3 |
arptables.c | 7 ++++---
|
|
|
0890d3 |
libarptc/libarptc.c | 2 +-
|
|
|
0890d3 |
2 files changed, 5 insertions(+), 4 deletions(-)
|
|
|
0890d3 |
|
|
|
0890d3 |
diff --git a/arptables.c b/arptables.c
|
|
|
0890d3 |
index 845e226a98a30..f820ffa894e00 100644
|
|
|
0890d3 |
--- a/arptables.c
|
|
|
0890d3 |
+++ b/arptables.c
|
|
|
0890d3 |
@@ -2164,16 +2164,17 @@ int do_command(int argc, char *argv[], char **table, arptc_handle_t *handle)
|
|
|
0890d3 |
"-%c requires packet and byte counter",
|
|
|
0890d3 |
opt2char(OPT_COUNTERS));
|
|
|
0890d3 |
|
|
|
0890d3 |
- if (sscanf(pcnt, "%"PRIu64, &fw.counters.pcnt) != 1)
|
|
|
0890d3 |
+ if (sscanf(pcnt, "%"PRIu64,
|
|
|
0890d3 |
+ (uint64_t *)&fw.counters.pcnt) != 1)
|
|
|
0890d3 |
exit_error(PARAMETER_PROBLEM,
|
|
|
0890d3 |
"-%c packet counter not numeric",
|
|
|
0890d3 |
opt2char(OPT_COUNTERS));
|
|
|
0890d3 |
|
|
|
0890d3 |
- if (sscanf(bcnt, "%"PRIu64, &fw.counters.bcnt) != 1)
|
|
|
0890d3 |
+ if (sscanf(bcnt, "%"PRIu64,
|
|
|
0890d3 |
+ (uint64_t *)&fw.counters.bcnt) != 1)
|
|
|
0890d3 |
exit_error(PARAMETER_PROBLEM,
|
|
|
0890d3 |
"-%c byte counter not numeric",
|
|
|
0890d3 |
opt2char(OPT_COUNTERS));
|
|
|
0890d3 |
-
|
|
|
0890d3 |
break;
|
|
|
0890d3 |
|
|
|
0890d3 |
|
|
|
0890d3 |
diff --git a/libarptc/libarptc.c b/libarptc/libarptc.c
|
|
|
0890d3 |
index 2dcaaefff5b41..0025a75efc9ea 100644
|
|
|
0890d3 |
--- a/libarptc/libarptc.c
|
|
|
0890d3 |
+++ b/libarptc/libarptc.c
|
|
|
0890d3 |
@@ -134,7 +134,7 @@ dump_entry(STRUCT_ENTRY *e, const TC_HANDLE_T handle)
|
|
|
0890d3 |
printf("Flags: %02X\n", e->arp.flags);
|
|
|
0890d3 |
printf("Invflags: %02X\n", e->arp.invflags);
|
|
|
0890d3 |
printf("Counters: %"PRIu64" packets, %"PRIu64" bytes\n",
|
|
|
0890d3 |
- e->counters.pcnt, e->counters.bcnt);
|
|
|
0890d3 |
+ (uint64_t)e->counters.pcnt, (uint64_t)e->counters.bcnt);
|
|
|
0890d3 |
/*
|
|
|
0890d3 |
printf("Cache: %08X ", e->nfcache);
|
|
|
0890d3 |
if (e->nfcache & NFC_ALTERED) printf("ALTERED ");
|
|
|
0890d3 |
--
|
|
|
0890d3 |
2.21.0
|
|
|
0890d3 |
|