From owner-freebsd-net  Sat Nov  3 15:32:17 2001
Delivered-To: freebsd-net@freebsd.org
Received: from alf.uib.no (alf.uib.no [129.177.30.3])
	by hub.freebsd.org (Postfix) with ESMTP id F083137B405
	for <freebsd-net@freebsd.org>; Sat,  3 Nov 2001 15:32:11 -0800 (PST)
Received: from tunnel-45-11.vpn.uib.no (ii.uib.no) [129.177.45.11] 
	by alf.uib.no  with esmtp (Exim 3.16)
	id 160AFr-0001dG-00; Sun, 04 Nov 2001 00:31:11 +0100
Message-ID: <3BE47F52.2050001@ii.uib.no>
Date: Sun, 04 Nov 2001 00:35:46 +0100
From: Trond Davidsen <trond.davidsen@ii.uib.no>
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:0.9.3) Gecko/20010909
X-Accept-Language: en-us
MIME-Version: 1.0
To: Archie Cobbs <archie@dellroad.org>
Cc: freebsd-net@FreeBSD.ORG
Subject: Re: Mpd with a large number, 200+ , of bundles
References: <200111031831.fA3IVl424031@arch20m.dellroad.org>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanner: exiscan *160AFr-0001dG-00*pktzQiO6l0o* http://tjinfo.uib.no/virus.html
Sender: owner-freebsd-net@FreeBSD.ORG
Precedence: bulk
List-ID: <freebsd-net.FreeBSD.ORG>
List-Archive: <http://docs.freebsd.org/mail/> (Web Archive)
List-Help: <mailto:majordomo@FreeBSD.ORG?subject=help> (List Instructions)
List-Subscribe: <mailto:majordomo@FreeBSD.ORG?subject=subscribe%20freebsd-net>
List-Unsubscribe: <mailto:majordomo@FreeBSD.ORG?subject=unsubscribe%20freebsd-net>
X-Loop: FreeBSD.org

Archie Cobbs wrote:

> 
> I think this error must be coming from the socket code. I wonder
> if increasing the receive buffer size on the netgraph socket would
> help.. try this patch for example:
> 
> Index: main.c
> ===================================================================
> RCS file: /home/cvs/freebsd/src/usr.sbin/ngctl/main.c,v
> retrieving revision 1.4.2.3
> diff -u -r1.4.2.3 main.c
> --- main.c	2001/01/09 06:52:25	1.4.2.3
> +++ main.c	2001/11/03 18:29:33
> @@ -145,6 +145,13 @@
>  	if (NgMkSockNode(name, &csock, &dsock) < 0)
>  		err(EX_OSERR, "can't create node");
>  
> +    {
> +	int size = 128 * 1024;
> +
> +	if (setsockopt(csock, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)) == -1)
> +		err(1, "setsockopt");
> +    }
> +
>  	/* Do commands as requested */
>  	if (ac == 0) {
>  		if (fp != NULL) {
> 
> 

After applying this patch, running 'ngctl list' lists bundles 240 - 160:

[removed lots of output]

   Name: mpd-pptp160     Type: ppp             ID: 00000330   Num hooks: 6
   Name: ng170           Type: iface           ID: 0000032f   Num hooks: 1
   Name: <unnamed>       Type: socket          ID: 0000032e   Num hooks: 2
   Name: <unnamed>       Type: vjc             ID: 0000032d   Num hooks: 4
   Name: <unnamed>       Type: bpf             ID: 0000032c   Num hooks: 3
   Name: fxp0            Type: ether           ID: 00000001   Num hooks: 0
ngctl: send msg: No such file or directory
vpn-gw3#


Running 'ngctl -d list' lists bundles 240 - 160:

[removed lots of output]

   Name: mpd-pptp160     Type: ppp             ID: 00000330   Num hooks: 6
   Name: ng170           Type: iface           ID: 0000032f   Num hooks: 1
   Name: <unnamed>       Type: socket          ID: 0000032e   Num hooks: 2
   Name: <unnamed>       Type: vjc             ID: 0000032d   Num hooks: 4
   Name: <unnamed>       Type: bpf             ID: 0000032c   Num hooks: 3
   Name: fxp0            Type: ether           ID: 00000001   Num hooks: 0
ngctl: sendto([bfbffbf8]:): No such file or directory
ngctl: send msg: No such file or directory
vpn-gw3#


Running 'ngctl -dd list' fills the screen with message dumps, and ends 
with 'Bus error (core dumped)', gdb shows this:

[removed lots of output]

Program received signal SIGBUS, Bus error.
0x2806a12e in _NgDebugBytes () from /usr/lib/libnetgraph.so.1
(gdb) bt
#0  0x2806a12e in _NgDebugBytes () from /usr/lib/libnetgraph.so.1
#1  0x2806a051 in _NgDebugMsg () from /usr/lib/libnetgraph.so.1
#2  0x2806af7b in NgRecvMsg () from /usr/lib/libnetgraph.so.1
#3  0x804a791 in ListCmd (ac=0, av=0xbfbfca5c)
     at /usr/src/usr.sbin/ngctl/list.c:93
#4  0x80495d2 in DoCommand (ac=1, av=0xbfbfca58)
     at /usr/src/usr.sbin/ngctl/main.c:306
#5  0x804956e in DoParseCommand (line=0xbfbfd2f8 "list")
     at /usr/src/usr.sbin/ngctl/main.c:290
#6  0x804949b in DoInteractive () at /usr/src/usr.sbin/ngctl/main.c:268
#7  0x8048e47 in main (ac=0, av=0xbfbffc30)
     at /usr/src/usr.sbin/ngctl/main.c:160
#8  0x8048b81 in _start ()
(gdb)


Trond



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message