summaryrefslogtreecommitdiff
path: root/print-pflog.c
diff options
context:
space:
mode:
authorguy <guy>2004-04-02 06:48:10 +0000
committerguy <guy>2004-04-02 06:48:10 +0000
commit0fc591e04206a133ac83b73774cf266fc0e435c0 (patch)
treeb97385a0cbb0b4928717baa6915f1b2fd37406f8 /print-pflog.c
parentc8b204e8f7ed33ef22076428ce5345bbccf09806 (diff)
downloadtcpdump-0fc591e04206a133ac83b73774cf266fc0e435c0.tar.gz
Save the host-byte-order values for the rule number and sub rule number
in variables; this means we put them in host byte order only once, and also gets rid of some "int format, long int argument" warnings.
Diffstat (limited to 'print-pflog.c')
-rw-r--r--print-pflog.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/print-pflog.c b/print-pflog.c
index 869716dc..463cd18b 100644
--- a/print-pflog.c
+++ b/print-pflog.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.11 2004-03-29 21:58:53 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.12 2004-04-02 06:48:10 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -75,11 +75,14 @@ static struct tok pf_directions[] = {
static void
pflog_print(const struct pfloghdr *hdr)
{
- if (ntohl(hdr->subrulenr) == (u_int32_t)-1)
- printf("rule %u/", ntohl(hdr->rulenr));
+ u_int32_t rulenr, subrulenr;
+
+ rulenr = ntohl(hdr->rulenr);
+ subrulenr = ntohl(hdr->subrulenr);
+ if (subrulenr == (u_int32_t)-1)
+ printf("rule %u/", rulenr);
else
- printf("rule %u.%s.%u/", ntohl(hdr->rulenr), hdr->ruleset,
- ntohl(hdr->subrulenr));
+ printf("rule %u.%s.%u/", rulenr, hdr->ruleset, subrulenr);
printf("%s: %s %s on %s: ",
tok2str(pf_reasons, "unkn(%u)", hdr->reason),