aboutsummaryrefslogtreecommitdiff
path: root/sbin/pfctl
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2014-03-05 00:40:03 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2014-03-05 00:40:03 +0000
commitfb3541ad15f18d7dd4149c314e7a53d5013f6d04 (patch)
tree89593eebe349b3d4fc7b7edf900fcb2a5130d510 /sbin/pfctl
parentbb725fc51aeb369f17d1b134b0ca95169581b429 (diff)
downloadsrc-fb3541ad15f18d7dd4149c314e7a53d5013f6d04.tar.gz
src-fb3541ad15f18d7dd4149c314e7a53d5013f6d04.zip
Instead of playing games with casts simply add 3 more members to the
structure pf_rule, that are used when the structure is passed via ioctl(). PR: 187074
Notes
Notes: svn path=/head/; revision=262760
Diffstat (limited to 'sbin/pfctl')
-rw-r--r--sbin/pfctl/pfctl.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 05b97fa40693..632eafc50442 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$");
#include <err.h>
#include <errno.h>
#include <fcntl.h>
-#include <inttypes.h>
#include <limits.h>
#include <netdb.h>
#include <stdio.h>
@@ -792,18 +791,17 @@ pfctl_print_rule_counters(struct pf_rule *rule, int opts)
}
if (opts & PF_OPT_VERBOSE) {
printf(" [ Evaluations: %-8llu Packets: %-8llu "
- "Bytes: %-10llu States: %-6"PRIuPTR"]\n",
+ "Bytes: %-10llu States: %-6lu]\n",
(unsigned long long)rule->evaluations,
(unsigned long long)(rule->packets[0] +
rule->packets[1]),
(unsigned long long)(rule->bytes[0] +
- rule->bytes[1]),
- (uintptr_t)rule->states_cur);
+ rule->bytes[1]), rule->u_states_cur);
if (!(opts & PF_OPT_DEBUG))
printf(" [ Inserted: uid %u pid %u "
- "State Creations: %-6"PRIuPTR"]\n",
+ "State Creations: %-6lu]\n",
(unsigned)rule->cuid, (unsigned)rule->cpid,
- (uintptr_t)rule->states_tot);
+ rule->u_states_tot);
}
}
@@ -905,7 +903,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format,
case PFCTL_SHOW_LABELS:
if (pr.rule.label[0]) {
printf("%s %llu %llu %llu %llu"
- " %llu %llu %llu %"PRIuPTR"\n",
+ " %llu %llu %llu %llu\n",
pr.rule.label,
(unsigned long long)pr.rule.evaluations,
(unsigned long long)(pr.rule.packets[0] +
@@ -916,7 +914,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format,
(unsigned long long)pr.rule.bytes[0],
(unsigned long long)pr.rule.packets[1],
(unsigned long long)pr.rule.bytes[1],
- (uintptr_t)pr.rule.states_tot);
+ (unsigned long long)pr.rule.u_states_tot);
}
break;
case PFCTL_SHOW_RULES: