Bug 123670 - sysutils/Pftop shows a wrong direction of filtering rules.
Summary: sysutils/Pftop shows a wrong direction of filtering rules.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Wesley Shields
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-14 15:00 UTC by Andrey Groshev
Modified: 2008-05-19 14:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Groshev 2008-05-14 15:00:03 UTC
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.

Fix: 

#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");--AvNzNXcwf2xLW2q0ESdJ724Y8o2jcX845EgMCT7q6XflT33L
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- 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" };
Comment 1 Wesley Shields freebsd_committer freebsd_triage 2008-05-14 19:24:59 UTC
Responsible Changed
From-To: freebsd-ports-bugs->wxs

I'll take it.
Comment 2 dfilter service freebsd_committer freebsd_triage 2008-05-19 14:01:39 UTC
wxs         2008-05-19 13:01:33 UTC

  FreeBSD ports repository

  Modified files:
    sysutils/pftop       Makefile 
    sysutils/pftop/files patch-pftop.c 
  Log:
  Update patch to properly display direction of filtering rules.
  Bump PORTREVISION.
  
  PR:             ports/123670
  Submitted by:   Andrey Groshev <greenx@yandex.ru>
  Reviewed by:    mlaier (maintainer)
  Approved by:    garga (mentor), mlaier (maintainer)
  
  Revision  Changes    Path
  1.12      +1 -0      ports/sysutils/pftop/Makefile
  1.2       +19 -4     ports/sysutils/pftop/files/patch-pftop.c
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Wesley Shields freebsd_committer freebsd_triage 2008-05-19 14:01:45 UTC
State Changed
From-To: open->closed

Committed, with minor changes. Thanks!