On Saturday 14 July 2007, Pav Lucistnik wrote:
> > building pfstat-2.2_3 on hammer3.isc.gumbysoft.com
...
> > cc -O1 -pipe   -Wall -I/usr/local/include
> > -I/work/a/ports/sysutils/pfstat/work/pfstat-2.2  -c pf.c
> > pf.c: In function 'query_ifaces':
> > pf.c:145: error: array type has incomplete element type
> > pf.c:152: error: 'PFI_FLAG_ALLMASK' undeclared (first use in this
> > function)
> > pf.c:152: error: (Each undeclared identifier is reported only once
> > pf.c:152: error: for each function it appears in.) 
> > pf.c:145: warning: unused variable 'ifs'
> > *** Error code 1
> >
> > Stop in /work/a/ports/sysutils/pfstat/work/pfstat-2.2.
> > *** Error code 1
> >
> > Stop in /a/ports/sysutils/pfstat.
> > ================================================================
> > build of /usr/ports/sysutils/pfstat ended at Sat Jul 14 02:37:11 UTC
> > 2007

Fix attached - could somebody please add required ports-foo and commit?  
Thanks!  Note that this adds a new file "pre41-patch-pf.c"

-- 
/"\  Best regards,                      | [EMAIL PROTECTED]
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | [EMAIL PROTECTED]
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News
Index: Makefile
===================================================================
RCS file: /usr/store/mlaier/fcvs/ports/sysutils/pfstat/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- Makefile	19 May 2007 20:23:30 -0000	1.11
+++ Makefile	14 Jul 2007 15:59:40 -0000
@@ -38,6 +38,9 @@
 		${WRKSRC}/Makefile
 	@${REINPLACE_CMD} -e "s|/etc/|${PREFIX}/etc/|" \
 		${WRKSRC}/pfstat.[c8]
+.if ${OSVERSION} < 700048
+	@${PATCH} ${WRKSRC}/pf.c ${PATCHDIR}/pre41-patch-pf.c
+.endif
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/pfstat ${PREFIX}/bin
Index: files/patch-pf.c
===================================================================
RCS file: /usr/store/mlaier/fcvs/ports/sysutils/pfstat/files/patch-pf.c,v
retrieving revision 1.2
diff -u -r1.2 patch-pf.c
--- files/patch-pf.c	16 Dec 2006 01:58:38 -0000	1.2
+++ files/patch-pf.c	14 Jul 2007 15:53:34 -0000
@@ -13,32 +13,3 @@
  	mnr = pa.nr;
  
  	/* fetch each of those queues */
-@@ -144,23 +142,24 @@
- query_ifaces(int fd, void (*cb)(int, const char *, int, double))
- {
- 	struct pfioc_iface io;
--	struct pfi_kif ifs[256];
-+	struct pfi_if ifs[256];
- 	int i, j;
- 
- 	memset(&io, 0, sizeof(io));
- 	io.pfiio_buffer = ifs;
- 	io.pfiio_esize = sizeof(ifs[0]);
- 	io.pfiio_size = sizeof(ifs) / sizeof(ifs[0]);
-+	io.pfiio_flags = PFI_FLAG_ALLMASK;
- 	if (ioctl(fd, DIOCIGETIFACES, &io)) {
- 		fprintf(stderr, "ioctl: DIOCIGETIFACES: %s\n", strerror(errno));
- 		return (1);
- 	}
- 	for (i = 0; i < io.pfiio_size; ++i)
- 		for (j = 0; j < 16; ++j)
--			(*cb)(COL_TYPE_IFACE, ifs[i].pfik_name,
-+			(*cb)(COL_TYPE_IFACE, ifs[i].pfif_name,
- 			    j, j & 4 ?
--			    ifs[i].pfik_packets[j&1?0:1][j&2?0:1][j&8?0:1] :
--			    ifs[i].pfik_bytes[j&1?0:1][j&2?0:1][j&8?0:1]);
-+			    ifs[i].pfif_packets[j&1?0:1][j&2?0:1][j&8?0:1] :
-+			    ifs[i].pfif_bytes[j&1?0:1][j&2?0:1][j&8?0:1]);
- 	/* bytes/packets[af][dir][op] */
- 	return (0);
- }
Index: files/pre41-patch-pf.c
===================================================================
RCS file: files/pre41-patch-pf.c
diff -N files/pre41-patch-pf.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/pre41-patch-pf.c	14 Jul 2007 15:53:34 -0000
@@ -0,0 +1,31 @@
+--- pf.c.orig	Thu May 11 23:41:07 2006
++++ pf.c	Mon Dec 11 21:08:31 2006
+@@ -144,23 +142,24 @@
+ query_ifaces(int fd, void (*cb)(int, const char *, int, double))
+ {
+ 	struct pfioc_iface io;
+-	struct pfi_kif ifs[256];
++	struct pfi_if ifs[256];
+ 	int i, j;
+ 
+ 	memset(&io, 0, sizeof(io));
+ 	io.pfiio_buffer = ifs;
+ 	io.pfiio_esize = sizeof(ifs[0]);
+ 	io.pfiio_size = sizeof(ifs) / sizeof(ifs[0]);
++	io.pfiio_flags = PFI_FLAG_ALLMASK;
+ 	if (ioctl(fd, DIOCIGETIFACES, &io)) {
+ 		fprintf(stderr, "ioctl: DIOCIGETIFACES: %s\n", strerror(errno));
+ 		return (1);
+ 	}
+ 	for (i = 0; i < io.pfiio_size; ++i)
+ 		for (j = 0; j < 16; ++j)
+-			(*cb)(COL_TYPE_IFACE, ifs[i].pfik_name,
++			(*cb)(COL_TYPE_IFACE, ifs[i].pfif_name,
+ 			    j, j & 4 ?
+-			    ifs[i].pfik_packets[j&1?0:1][j&2?0:1][j&8?0:1] :
+-			    ifs[i].pfik_bytes[j&1?0:1][j&2?0:1][j&8?0:1]);
++			    ifs[i].pfif_packets[j&1?0:1][j&2?0:1][j&8?0:1] :
++			    ifs[i].pfif_bytes[j&1?0:1][j&2?0:1][j&8?0:1]);
+ 	/* bytes/packets[af][dir][op] */
+ 	return (0);
+ }

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to