NetBSD Problem Report #36250

From martin@duskware.de  Mon Apr 30 09:30:38 2007
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 2132363B960
	for <gnats-bugs@gnats.netbsd.org>; Mon, 30 Apr 2007 09:30:38 +0000 (UTC)
Message-Id: <20070430092504.BC8D863B960@narn.NetBSD.org>
Date: Mon, 30 Apr 2007 09:25:04 +0000 (UTC)
From: bartosz.kuzma@gmail.com
Reply-To: bartosz.kuzma@gmail.com
To: netbsd-bugs-owner@NetBSD.org
Subject: net/darkstat update
X-Send-Pr-Version: www-1.0

>Number:         36250
>Category:       pkg
>Synopsis:       net/darkstat update
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    obache
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 30 09:35:00 +0000 2007
>Closed-Date:    Wed May 09 13:42:26 +0000 2007
>Last-Modified:  Wed May 09 13:50:02 +0000 2007
>Originator:     Bartosz Kuzma
>Release:        NetBSD 3.1
>Organization:
>Environment:
NetBSD gdr74.internetdsl.tpnet.pl 3.1 NetBSD 3.1 (GDR74) #1: Fri Apr 27 16:53:00 CEST 2007  bartosz@gdr74.internetdsl.tpnet.pl:/usr/obj/sys/arch/i386/compile/GDR74 i386
>Description:
net/darkstat update to 3.0.619

Changes from 3.0.540 to 3.0.619:
 - Decode DLT_PPP and DLT_PPP_SERIAL on NetBSD,
   patch courtesy of Bartosz Kuzma.
 - Don't use pcap_setnonblock(), with help from Colin Phipps.
 - Reduce the number of syscalls made.
 - Answer FAQ about graph axes / labels / scale.
 - Fix build on OpenBSD (thanks Chris!) and Solaris.
 - Commandline arg (-n) to disable promiscuous mode when
   sniffing, thanks to Chris Kuethe for the implementation.
 - Commandline arg (-r) to disable DNS resolver.
 - Track and report per-host last seen MAC address.
 - Move FAQ into manpage.
 - Implement display of start time and running time.
 - Web: implement sorting the hosts table by in/out/total.
 - Web: implement paging through the hosts table.
 - Web: implement full view of hosts table.
 - Don't die if the capture interface loses its IP address.
 - Make daemonize (previously -d) the default, and make -D the
   argument to suppress it.
 - Commandline arg (-l) to graph traffic entering/leaving the
   local network as opposed to just the local IP.  v2 had this.
 - Allow configure-time override of CHROOT_DIR and PRIVDROP_USER.
 - Web: new color scheme.
>How-To-Repeat:

>Fix:
Apply the following patch:

diff --exclude=CVS -N -u -r /usr/pkgsrc/net/darkstat/Makefile ./Makefile
--- /usr/pkgsrc/net/darkstat/Makefile	2007-01-17 19:10:57.000000000 +0100
+++ ./Makefile	2007-04-30 11:04:57.000000000 +0200
@@ -1,24 +1,20 @@
 # $NetBSD: Makefile,v 1.3 2006/10/07 07:49:01 obache Exp $
 #

-DISTNAME=		darkstat-3.0.540
+DISTNAME=		darkstat-3.0.619
 CATEGORIES=		net
 MASTER_SITES=		http://dmr.ath.cx/net/darkstat/
 DIST_SUBDIR=		darkstat
 EXTRACT_SUFX=		.tar.bz2

-MAINTAINER=		bartosz@atom.eu.org
+MAINTAINER=		bartosz.kuzma@gmail.com
 HOMEPAGE=		http://dmr.ath.cx/net/darkstat/
 COMMENT=		Network statistics gatherer

-SUBST_CLASSES+=		conv_c
-SUBST_STAGE.conv_c=	post-patch
-SUBST_FILES.conv_c=	conv.c
-SUBST_SED.conv_c=	-e 's,/var/empty,${PREFIX}/share/darkstat/chroot,'
-
 BUILD_TARGET=		darkstat

 GNU_CONFIGURE=		yes
+CONFIGURE_ARGS+=	--with-chroot-dir=${PREFIX}/share/darkstat/chroot

 post-install:
 	${INSTALL_DATA_DIR} ${PREFIX}/share/darkstat
diff --exclude=CVS -N -u -r /usr/pkgsrc/net/darkstat/distinfo ./distinfo
--- /usr/pkgsrc/net/darkstat/distinfo	2007-01-17 19:10:58.000000000 +0100
+++ ./distinfo	2007-04-30 11:11:30.000000000 +0200
@@ -1,6 +1,6 @@
 $NetBSD: distinfo,v 1.2 2006/10/07 07:49:01 obache Exp $

-SHA1 (darkstat/darkstat-3.0.540.tar.bz2) = aaca2ba07c8479b7bf2393261b0093f568746766
-RMD160 (darkstat/darkstat-3.0.540.tar.bz2) = c9ee36a5381bfc26c81759f4cde6153abac4264c
-Size (darkstat/darkstat-3.0.540.tar.bz2) = 75293 bytes
-SHA1 (patch-aa) = 8f5de074e5a5fc7798a8c196f116f12417b81d83
+SHA1 (darkstat/darkstat-3.0.619.tar.bz2) = d38aeb6c6a77b324cd1e267625f40509b358a83a
+RMD160 (darkstat/darkstat-3.0.619.tar.bz2) = 39fc8fa9e49b7cfe73917d97a062cd8855f38828
+Size (darkstat/darkstat-3.0.619.tar.bz2) = 82508 bytes
+SHA1 (patch-ab) = afb531d2c041582c1c6d62c948e7b58ca7f6bd1c
diff --exclude=CVS -N -u -r /usr/pkgsrc/net/darkstat/patches/patch-aa ./patches/patch-aa
--- /usr/pkgsrc/net/darkstat/patches/patch-aa	2007-01-17 19:10:58.000000000 +0100
+++ ./patches/patch-aa	1970-01-01 01:00:00.000000000 +0100
@@ -1,48 +0,0 @@
-$NetBSD: patch-aa,v 1.2 2006/10/07 07:49:01 obache Exp $
-
---- decode.c.orig	2006-08-07 02:26:32.000000000 +0200
-+++ decode.c
-@@ -54,6 +54,8 @@ static void decode_ether(u_char *, const
-    const u_char *);
- static void decode_loop(u_char *, const struct pcap_pkthdr *,
-    const u_char *);
-+static void decode_ppp(u_char *, const struct pcap_pkthdr *,
-+   const u_char *);
- static void decode_pppoe(u_char *, const struct pcap_pkthdr *,
-    const u_char *);
- static void decode_linux_sll(u_char *, const struct pcap_pkthdr *,
-@@ -67,7 +69,10 @@ static const linkhdr_t linkhdrs[] = {
-    { DLT_EN10MB,    ETHER_HDR_LEN, decode_ether  },
-    { DLT_LOOP,      NULL_HDR_LEN,  decode_loop  },
-    { DLT_NULL,      NULL_HDR_LEN,  decode_loop  },
--   { DLT_PPP,       PPP_HDR_LEN,   NULL },
-+   { DLT_PPP,       PPP_HDR_LEN,   decode_ppp },
-+#if defined(__NetBSD__)
-+   { DLT_PPP_SERIAL, PPP_HDR_LEN, decode_ppp },
-+#endif
-    { DLT_FDDI,      FDDI_HDR_LEN,  NULL },
-    { DLT_PPP_ETHER, PPPOE_HDR_LEN, decode_pppoe },
-    { DLT_LINUX_SLL, SLL_HDR_LEN,   decode_linux_sll },
-@@ -172,6 +177,22 @@ decode_loop(u_char *user _unused_,
- }
- 
- static void
-+decode_ppp(u_char *user _unused_,
-+      const struct pcap_pkthdr *pheader,
-+      const u_char *pdata)
-+{
-+   pktsummary sm;
-+   memset(&sm, 0, sizeof(sm));
-+
-+   if (pdata[2] == 0x00 && pdata[3] == 0x21) {
-+         decode_ip(pdata + PPP_HDR_LEN, pheader->caplen - PPP_HDR_LEN, &sm);
-+         sm.time = pheader->ts.tv_sec;
-+         acct_for(&sm);
-+   } else
-+      verbosef("non-IP PPP packet; ignoring.");
-+}
-+
-+static void
- decode_pppoe(u_char *user _unused_,
-       const struct pcap_pkthdr *pheader,
-       const u_char *pdata)
diff --exclude=CVS -N -u -r /usr/pkgsrc/net/darkstat/patches/patch-ab ./patches/patch-ab
--- /usr/pkgsrc/net/darkstat/patches/patch-ab	1970-01-01 01:00:00.000000000 +0100
+++ ./patches/patch-ab	2007-04-29 12:31:06.000000000 +0200
@@ -0,0 +1,19 @@
+$NetBSD$
+
+--- configure.orig	2007-04-29 12:19:45.000000000 +0200
++++ configure
+@@ -1702,13 +1702,7 @@ RULE="----------------------------------
+ 
+ # Check whether --with-chroot-dir was given.
+ if test "${with_chroot_dir+set}" = set; then
+-  withval=$with_chroot_dir; if test \! -d "$withval" ; then
+-   { { echo "$as_me:$LINENO: error: directory $withval doesn't exist" >&5
+-echo "$as_me: error: directory $withval doesn't exist" >&2;}
+-   { (exit 1); exit 1; }; }
+-  else
+-   _chd="$withval"
+-  fi
++  _chd=$with_chroot_dir
+ else
+   # Find an "empty" directory to serve as the chroot.
+   _chd="/var/empty"

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->obache
Responsible-Changed-By: obache@netbsd.org
Responsible-Changed-When: Wed, 09 May 2007 13:35:47 +0000
Responsible-Changed-Why:
I'll handle this.


State-Changed-From-To: open->closed
State-Changed-By: obache@netbsd.org
State-Changed-When: Wed, 09 May 2007 13:42:26 +0000
State-Changed-Why:
Patch applied.  Thanks!


From: OBATA Akio <obache@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/36250 CVS commit: pkgsrc/net/darkstat
Date: Wed,  9 May 2007 13:39:12 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Wed May  9 13:39:12 UTC 2007

 Modified Files:
 	pkgsrc/net/darkstat: Makefile distinfo
 Added Files:
 	pkgsrc/net/darkstat/patches: patch-ab
 Removed Files:
 	pkgsrc/net/darkstat/patches: patch-aa

 Log Message:
 Update darkstat to 3.0.619.
 Patch provided by MAINTAINER, Bartosz Kuzma in PR 36250.

 Changes from 3.0.540 to 3.0.619:
  - Decode DLT_PPP and DLT_PPP_SERIAL on NetBSD,
    patch courtesy of Bartosz Kuzma.
  - Don't use pcap_setnonblock(), with help from Colin Phipps.
  - Reduce the number of syscalls made.
  - Answer FAQ about graph axes / labels / scale.
  - Fix build on OpenBSD (thanks Chris!) and Solaris.
  - Commandline arg (-n) to disable promiscuous mode when
    sniffing, thanks to Chris Kuethe for the implementation.
  - Commandline arg (-r) to disable DNS resolver.
  - Track and report per-host last seen MAC address.
  - Move FAQ into manpage.
  - Implement display of start time and running time.
  - Web: implement sorting the hosts table by in/out/total.
  - Web: implement paging through the hosts table.
  - Web: implement full view of hosts table.
  - Don't die if the capture interface loses its IP address.
  - Make daemonize (previously -d) the default, and make -D the
    argument to suppress it.
  - Commandline arg (-l) to graph traffic entering/leaving the
    local network as opposed to just the local IP.  v2 had this.
  - Allow configure-time override of CHROOT_DIR and PRIVDROP_USER.
  - Web: new color scheme.


 To generate a diff of this commit:
 cvs rdiff -r1.3 -r1.4 pkgsrc/net/darkstat/Makefile
 cvs rdiff -r1.2 -r1.3 pkgsrc/net/darkstat/distinfo
 cvs rdiff -r1.2 -r0 pkgsrc/net/darkstat/patches/patch-aa
 cvs rdiff -r0 -r1.1 pkgsrc/net/darkstat/patches/patch-ab

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.