Replace hardcoded 0 and implicit checks with enum as done in all other
use cases of `pfra_fback'.

No object change.

OK?

Index: sys/net/pf_table.c
===================================================================
RCS file: /cvs/src/sys/net/pf_table.c,v
retrieving revision 1.128
diff -u -p -r1.128 pf_table.c
--- sys/net/pf_table.c  28 Mar 2018 10:56:18 -0000      1.128
+++ sys/net/pf_table.c  9 Oct 2018 18:38:33 -0000
@@ -741,7 +741,7 @@ pfr_validate_addr(struct pfr_addr *ad)
                        return (-1);
        if (ad->pfra_not && ad->pfra_not != 1)
                return (-1);
-       if (ad->pfra_fback)
+       if (ad->pfra_fback != PFR_FB_NONE)
                return (-1);
        if (ad->pfra_type >= PFRKE_MAX)
                return (-1);
Index: sbin/pfctl/pfctl_table.c
===================================================================
RCS file: /cvs/src/sbin/pfctl/pfctl_table.c,v
retrieving revision 1.77
diff -u -p -r1.77 pfctl_table.c
--- sbin/pfctl/pfctl_table.c    11 Aug 2017 22:30:38 -0000      1.77
+++ sbin/pfctl/pfctl_table.c    9 Oct 2018 18:31:11 -0000
@@ -209,7 +209,8 @@ pfctl_table(int argc, char *argv[], char
                xprintf(opts, "%d/%d addresses added", nadd, b.pfrb_size);
                if (opts & PF_OPT_VERBOSE)
                        PFRB_FOREACH(a, &b)
-                               if ((opts & PF_OPT_VERBOSE2) || a->pfra_fback)
+                               if (opts & PF_OPT_VERBOSE2 ||
+                                   a->pfra_fback != PFR_FB_NONE)
                                        print_addrx(a, NULL,
                                            opts & PF_OPT_USEDNS);
        } else if (!strcmp(command, "delete")) {
@@ -223,7 +224,8 @@ pfctl_table(int argc, char *argv[], char
                xprintf(opts, "%d/%d addresses deleted", ndel, b.pfrb_size);
                if (opts & PF_OPT_VERBOSE)
                        PFRB_FOREACH(a, &b)
-                               if ((opts & PF_OPT_VERBOSE2) || a->pfra_fback)
+                               if (opts & PF_OPT_VERBOSE2 ||
+                                   a->pfra_fback != PFR_FB_NONE)
                                        print_addrx(a, NULL,
                                            opts & PF_OPT_USEDNS);
        } else if (!strcmp(command, "replace")) {
@@ -254,7 +256,8 @@ pfctl_table(int argc, char *argv[], char
                        xprintf(opts, "no changes");
                if (opts & PF_OPT_VERBOSE)
                        PFRB_FOREACH(a, &b)
-                               if ((opts & PF_OPT_VERBOSE2) || a->pfra_fback)
+                               if (opts & PF_OPT_VERBOSE2 ||
+                                   a->pfra_fback != PFR_FB_NONE)
                                        print_addrx(a, NULL,
                                            opts & PF_OPT_USEDNS);
        } else if (!strcmp(command, "expire")) {
@@ -277,7 +280,7 @@ pfctl_table(int argc, char *argv[], char
                                break;
                }
                PFRB_FOREACH(p, &b) {
-                       ((struct pfr_astats *)p)->pfras_a.pfra_fback = 0;
+                       ((struct pfr_astats *)p)->pfras_a.pfra_fback = 
PFR_FB_NONE;
                        if (time(NULL) - ((struct pfr_astats *)p)->pfras_tzero >
                             lifetime)
                                if (pfr_buf_add(&b2,
@@ -292,7 +295,8 @@ pfctl_table(int argc, char *argv[], char
                xprintf(opts, "%d/%d addresses expired", ndel, b2.pfrb_size);
                if (opts & PF_OPT_VERBOSE)
                        PFRB_FOREACH(a, &b2)
-                               if ((opts & PF_OPT_VERBOSE2) || a->pfra_fback)
+                               if (opts & PF_OPT_VERBOSE2 ||
+                                   a->pfra_fback != PFR_FB_NONE)
                                        print_addrx(a, NULL,
                                            opts & PF_OPT_USEDNS);
        } else if (!strcmp(command, "show")) {

Reply via email to