From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: zhangcy@cn.fujitsu.com
Subject: [PATCH arptables 2/2] src: fix compilation warning
Date: Thu, 2 Apr 2015 10:51:17 +0200 [thread overview]
Message-ID: <1427964677-5887-2-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1427964677-5887-1-git-send-email-pablo@netfilter.org>
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@netfilter.org>
---
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-04-02 8:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-02 8:51 [PATCH arptables 1/2] src: cache in tree and use x_tables.h Pablo Neira Ayuso
2015-04-02 8:51 ` Pablo Neira Ayuso [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1427964677-5887-2-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=zhangcy@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).