pfctl(8): Fix some little printf() issues on x86_64 (fixes buildworld).
authorSascha Wildner <saw@online.de>
Sun, 8 Aug 2010 21:24:30 +0000 (23:24 +0200)
committerSascha Wildner <saw@online.de>
Sun, 8 Aug 2010 21:24:30 +0000 (23:24 +0200)
usr.sbin/pfctl/pf_print_state.c
usr.sbin/pfctl/pfctl_parser.c

index 224e3e5..3d576a1 100644 (file)
@@ -278,8 +278,9 @@ print_state(struct pf_state *s, int opts)
                min = s->expire % 60;
                s->expire /= 60;
                printf(", expires in %.2u:%.2u:%.2u", s->expire, min, sec);
-               printf(", %llu:%llu pkts, %llu:%llu bytes",
-                   s->packets[0], s->packets[1], s->bytes[0], s->bytes[1]);
+               printf(", %ju:%ju pkts, %ju:%ju bytes",
+                   (uintmax_t)s->packets[0], (uintmax_t)s->packets[1],
+                   (uintmax_t)s->bytes[0], (uintmax_t)s->bytes[1]);
                if (s->anchor.nr != (unsigned)-1)
                        printf(", anchor %u", s->anchor.nr);
                if (s->rule.nr != (unsigned)-1)
index 4d635cc..a50d692 100644 (file)
@@ -594,8 +594,8 @@ print_status(struct pf_status *s, int opts)
        if (opts & PF_OPT_VERBOSE) {
                printf("Limit Counters\n");
                for (i = 0; i < LCNT_MAX; i++) {
-                       printf("  %-25s %14lld ", pf_lcounters[i],
-                                   s->lcounters[i]);
+                       printf("  %-25s %14ju ", pf_lcounters[i],
+                                   (uintmax_t)s->lcounters[i]);
                        if (runtime > 0)
                                printf("%14.1f/s\n",
                                    (double)s->lcounters[i] / (double)runtime);
@@ -639,9 +639,9 @@ print_src_node(struct pf_src_node *sn, int opts)
                        printf(", expires in %.2u:%.2u:%.2u",
                            sn->expire, min, sec);
                }
-               printf(", %llu pkts, %llu bytes",
-                   sn->packets[0] + sn->packets[1],
-                   sn->bytes[0] + sn->bytes[1]);
+               printf(", %ju pkts, %ju bytes",
+                   (uintmax_t)sn->packets[0] + sn->packets[1],
+                   (uintmax_t)sn->bytes[0] + sn->bytes[1]);
                switch (sn->ruletype) {
                case PF_NAT:
                        if (sn->rule.nr != (uint32_t)(-1))