diff options
author | mpf <mpf@openbsd.org> | 2008-05-09 11:57:52 +0000 |
---|---|---|
committer | mpf <mpf@openbsd.org> | 2008-05-09 11:57:52 +0000 |
commit | 25c4ae05b1702bb7be23cb04f6a8446ff577d1bf (patch) | |
tree | c945842b2a4e50bc5f4e34e8234773066fee5db9 /usr.sbin/tcpdump/pf_print_state.c | |
parent | procfs can use vop_generic_bmap too; (diff) | |
download | wireguard-openbsd-25c4ae05b1702bb7be23cb04f6a8446ff577d1bf.tar.xz wireguard-openbsd-25c4ae05b1702bb7be23cb04f6a8446ff577d1bf.zip |
Don't just ntohl() the hours, but everything of the state
creation time. OK mcbride@, henning@.
Diffstat (limited to 'usr.sbin/tcpdump/pf_print_state.c')
-rw-r--r-- | usr.sbin/tcpdump/pf_print_state.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.sbin/tcpdump/pf_print_state.c b/usr.sbin/tcpdump/pf_print_state.c index 5ebf039c0fe..745dadc9da2 100644 --- a/usr.sbin/tcpdump/pf_print_state.c +++ b/usr.sbin/tcpdump/pf_print_state.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_print_state.c,v 1.4 2007/05/31 04:16:26 mcbride Exp $ */ +/* $OpenBSD: pf_print_state.c,v 1.5 2008/05/09 11:57:52 mpf Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -243,12 +243,13 @@ print_state(struct pfsync_state *s, int opts) if (opts & PF_OPT_VERBOSE) { u_int64_t packets[2]; u_int64_t bytes[2]; + u_int32_t creation = ntohl(s->creation); - sec = s->creation % 60; - s->creation /= 60; - min = s->creation % 60; - s->creation /= 60; - printf("\n age %.2u:%.2u:%.2u", ntohl(s->creation), min, sec); + sec = creation % 60; + creation /= 60; + min = creation % 60; + creation /= 60; + printf("\n age %.2u:%.2u:%.2u", creation, min, sec); sec = s->expire % 60; s->expire /= 60; min = s->expire % 60; |