diff options
author | glebius <glebius@FreeBSD.org> | 2014-03-05 00:40:03 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2014-03-05 00:40:03 +0000 |
commit | c23c087e5b36b9341d9242aae6bd8eb7835dfd43 (patch) | |
tree | 89593eebe349b3d4fc7b7edf900fcb2a5130d510 /sbin/pfctl | |
parent | c6f1c4558bdff3804aef40677abb583cc38f0ac5 (diff) | |
download | FreeBSD-src-c23c087e5b36b9341d9242aae6bd8eb7835dfd43.zip FreeBSD-src-c23c087e5b36b9341d9242aae6bd8eb7835dfd43.tar.gz |
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
Diffstat (limited to 'sbin/pfctl')
-rw-r--r-- | sbin/pfctl/pfctl.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 05b97fa..632eafc 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: |