summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw/dummynet.c
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2010-04-19 15:11:45 +0000
committerluigi <luigi@FreeBSD.org>2010-04-19 15:11:45 +0000
commit063c00f467c27760c023e7f170a99f4597aa1530 (patch)
treed9f866005d7425f44adb9222a2ba4daa870e56aa /sbin/ipfw/dummynet.c
parent9e69ae693d6fdbdb4278ec49ab30c64f73954d40 (diff)
downloadFreeBSD-src-063c00f467c27760c023e7f170a99f4597aa1530.zip
FreeBSD-src-063c00f467c27760c023e7f170a99f4597aa1530.tar.gz
Slightly different handling of printf/snprintf for unaligned uint64_t,
which should improve readability, and also to ease the port to platforms that do not support %llu MFC after: 3 days
Diffstat (limited to 'sbin/ipfw/dummynet.c')
-rw-r--r--sbin/ipfw/dummynet.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/ipfw/dummynet.c b/sbin/ipfw/dummynet.c
index eb6547a..19d52a4 100644
--- a/sbin/ipfw/dummynet.c
+++ b/sbin/ipfw/dummynet.c
@@ -203,9 +203,9 @@ list_flow(struct dn_flow *ni)
inet_ntop(AF_INET6, &(id->dst_ip6), buff, sizeof(buff)),
id->dst_port);
}
- printf("%4llu %8llu %2u %4u %3u\n",
- align_uint64(&ni->tot_pkts),
- align_uint64(&ni->tot_bytes),
+ pr_u64(&ni->tot_pkts, 4);
+ pr_u64(&ni->tot_bytes, 8);
+ printf("%2u %4u %3u\n",
ni->length, ni->len_bytes, ni->drops);
}
@@ -290,8 +290,8 @@ static void
list_pipes(struct dn_id *oid, struct dn_id *end)
{
char buf[160]; /* pending buffer */
- buf[0] = '\0';
+ buf[0] = '\0';
for (; oid != end; oid = O_NEXT(oid, oid->len)) {
if (oid->len < sizeof(*oid))
errx(1, "invalid oid len %d\n", oid->len);
OpenPOWER on IntegriCloud