Display direction In/Out/Any for rule display, not just In/Out.
authorsthen <sthen@openbsd.org>
Mon, 1 Sep 2008 23:30:08 +0000 (23:30 +0000)
committersthen <sthen@openbsd.org>
Mon, 1 Sep 2008 23:30:08 +0000 (23:30 +0000)
ok canacar@

usr.bin/systat/pftop.c

index e902baf..e69e117 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pftop.c,v 1.4 2008/07/16 10:23:39 canacar Exp $         */
+/* $Id: pftop.c,v 1.5 2008/09/01 23:30:08 sthen Exp $   */
 /*
  * Copyright (c) 2001, 2007 Can Erkin Acar
  * Copyright (c) 2001 Daniel Hartmeier
@@ -1281,7 +1281,13 @@ print_rule(struct pf_rule *pr)
        print_fld_size(FLD_BYTES, pr->bytes[0] + pr->bytes[1]);
 
        print_fld_uint(FLD_RULE, pr->nr);
-       print_fld_str(FLD_DIR, pr->direction == PF_OUT ? "Out" : "In");
+       if (pr->direction == PF_OUT)
+               print_fld_str(FLD_DIR, "Out");
+       else if (pr->direction == PF_IN)
+               print_fld_str(FLD_DIR, "In");
+       else
+               print_fld_str(FLD_DIR, "Any");
+
        if (pr->quick)
                print_fld_str(FLD_QUICK, "Quick");