Date: Mon, 28 Oct 2002 07:12:47 -0800 (PST) From: FUKAUMI Naoki <naoki@fukaumi.org> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/44567: ipfstat does not show IPv6 accounting info Message-ID: <200210281512.g9SFCl23048125@www.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 44567
>Category: bin
>Synopsis: ipfstat does not show IPv6 accounting info
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Oct 28 07:20:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: FUKAUMI Naoki
>Release: 5-CURRENT
>Organization:
FUKAUMI Naoki
>Environment:
5-CURRENT
>Description:
ipf supports accounting rule for IPv6. But ipfstat can't show
accounting information for IPv6.
>How-To-Repeat:
# echo 'count in all' | ipf -6 -f -
# echo 'count out all' | ipf -f -
# ipfstat -6 -aio
0 count out from any to any
empty list for ipacct(in)
(This is accounting rule for IPv4)
>Fix:
This is patch (which was sent to author of IP Filter)
--- src/contrib/ipfilter/fils.c.orig Wed Oct 2 10:39:17 2002
+++ src/contrib/ipfilter/fils.c Mon Oct 28 16:35:30 2002
@@ -113,7 +113,8 @@
#define FPRINTF (void)fprintf
#define F_IN 0
#define F_OUT 1
-#define F_AC 2
+#define F_ACIN 2
+#define F_ACOUT 3
static char *filters[4] = { "ipfilter(in)", "ipfilter(out)",
"ipacct(in)", "ipacct(out)" };
@@ -782,13 +783,22 @@
if (opts & OPT_INACTIVE)
set = 1 - set;
if (opts & OPT_ACCNT) {
- i = F_AC;
+#ifdef USE_INET6
+ if ((use_inet6) && (opts & OPT_OUTQUE)) {
+ i = F_ACOUT;
+ fp = (struct frentry *)fiop->f_acctout6[set];
+ } else if ((use_inet6) && (opts & OPT_INQUE)) {
+ i = F_ACIN;
+ fp = (struct frentry *)fiop->f_acctin6[set];
+ } else
+#endif
if (opts & OPT_OUTQUE) {
+ i = F_ACOUT;
fp = (struct frentry *)fiop->f_acctout[set];
- i++;
- } else if (opts & OPT_INQUE)
+ } else if (opts & OPT_INQUE) {
+ i = F_ACIN;
fp = (struct frentry *)fiop->f_acctin[set];
- else {
+ } else {
FPRINTF(stderr, "No -i or -o given with -a\n");
return;
}
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210281512.g9SFCl23048125>
