Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 May 2008 13:52:40 GMT
From:      Andrey Groshev <greenx@yandex.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/123670: Pftop shows a wrong direction of filtering rules.
Message-ID:  <200805141352.m4EDqeC0010756@www.freebsd.org>
Resent-Message-ID: <200805141400.m4EE03oD077422@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         123670
>Category:       ports
>Synopsis:       Pftop shows a wrong direction of filtering rules.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 14 14:00:03 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Andrey Groshev
>Release:        7-stable
>Organization:
SPC NT Azimut LTD,
>Environment:
>Description:
There is a small inconvenience in browse mode of rules (pftop-v rules).
If on a filtering rule the direction is not specified, pftop displays it as "In"  - is confuses.
Further my variant of correction of the given lack.
>How-To-Repeat:

>Fix:
--- pftop.c     2008-05-14 17:06:57.000000000 +0400
+++ pftop.c     2008-05-14 17:07:41.000000000 +0400
@@ -1461,6 +1461,7 @@
        static const char *actiontypes[] = { "Pass", "Block", "Scrub", "Nat",
            "no Nat", "Binat", "no Binat", "Rdr", "no Rdr" };
        int numact = sizeof(actiontypes) / sizeof(char *);
+       static const char *directtypes[] = { "n/a", "In", "Out" };

 #ifdef HAVE_PF_ROUTE
        static const char *routetypes[] = { "", "fastroute", "route-to",
@@ -1486,7 +1487,7 @@
        print_fld_size(FLD_BYTES, pr->bytes);
 #endif
        print_fld_uint(FLD_RULE, pr->nr);
-       print_fld_str(FLD_DIR, pr->direction == PF_OUT ? "Out" : "In");
+       print_fld_str(FLD_DIR, directtypes[pr->direction]);
        if (pr->quick)
                print_fld_str(FLD_QUICK, "Quick");

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805141352.m4EDqeC0010756>