summaryrefslogtreecommitdiff
path: root/proto_igmp.c
diff options
context:
space:
mode:
authorJames McCoy <vega.james@gmail.com>2014-05-01 11:14:31 -0400
committerTobias Klauser <tklauser@distanz.ch>2014-05-03 13:36:36 +0200
commit7aa9f970e88382f2508ee55122e27cdcfd8cdbda (patch)
tree03ff36cfad0f1cc88c92b7764fd3b8145207d651 /proto_igmp.c
parent7231039ec891acee246549410c70f1151a0c0175 (diff)
all: Use macros for printf/scanf format specifiers
Any types that are fixed width should use the standard format specifier macros (PRI... for printf-type functions, SCN... for scanf-type functions) to ensure proper data access. Prior to this ifpps was crashing in 32-bit environments due to the following call mvwprintw(screen, (*voff)++, 2, "%s,%s %s (%s%s), t=%lums, cpus=%u%s/%u" " ", uts.release, machine, ifname, drvinf.driver, buff, ms_interval, top_cpus, top_cpus > 0 && top_cpus < cpus ? "+1" : "", cpus); since ms_interval is a uint64_t but %lu expects an unsigned long, which is only 32 bits. Signed-off-by: James McCoy <vega.james@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'proto_igmp.c')
-rw-r--r--proto_igmp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/proto_igmp.c b/proto_igmp.c
index b31f5a8..0ef38f9 100644
--- a/proto_igmp.c
+++ b/proto_igmp.c
@@ -4,6 +4,7 @@
* Subject to the GPL, version 2.
*/
+#include <inttypes.h>
#include <arpa/inet.h>
#include <asm/byteorder.h>
#include <netinet/in.h>
@@ -266,7 +267,7 @@ static void dissect_igmp_v0(struct pkt_buff *pkt)
tprintf(", Id (%u)", ntohs(msg->identifier));
inet_ntop(AF_INET, &msg->group_address, addr, sizeof(addr));
tprintf(", Group Addr (%s)", addr);
- tprintf(", Access Key (0x%.16lx)", msg->access_key);
+ tprintf(", Access Key (0x%.16"PRIx64")", msg->access_key);
tprintf(" ]\n");
}