From owner-freebsd-net Wed Oct 9 12:26:36 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 190EF37B401 for ; Wed, 9 Oct 2002 12:26:35 -0700 (PDT) Received: from carp.icir.org (carp.icir.org [192.150.187.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id BCBBB43E6E for ; Wed, 9 Oct 2002 12:26:34 -0700 (PDT) (envelope-from rizzo@carp.icir.org) Received: from carp.icir.org (localhost [127.0.0.1]) by carp.icir.org (8.12.3/8.12.3) with ESMTP id g99JQXO2052419; Wed, 9 Oct 2002 12:26:33 -0700 (PDT) (envelope-from rizzo@carp.icir.org) Received: (from rizzo@localhost) by carp.icir.org (8.12.3/8.12.3/Submit) id g99JQW73052418; Wed, 9 Oct 2002 12:26:32 -0700 (PDT) (envelope-from rizzo) Date: Wed, 9 Oct 2002 12:26:32 -0700 From: Luigi Rizzo To: Andrey Simonenko Cc: freebsd-net@FreeBSD.ORG Subject: Re: Q about sbin/ip6fw/ip6fw.c:list() Message-ID: <20021009122632.A52391@carp.icir.org> References: <20021007222647.B91626-100000@lion.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20021007222647.B91626-100000@lion.com.ua>; from simon@simon.org.ua on Mon, Oct 07, 2002 at 11:29:50PM +0300 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, Oct 07, 2002 at 11:29:50PM +0300, Andrey Simonenko wrote: > Hello, > > Why is it not allowed to get more that 65536 ip6fw rules from the kernel > in the ip6fw.c:list() function? i think it is just an oversight -- perhaps the author though that each rule had to have its own number. luigi > Here is some lines from ip6fw.c: > > maxbytes = 65536 * sizeof *rules; > while (bytes >= nalloc) { > nalloc = nalloc * 2 + 200; > bytes = nalloc; > if ((rules = realloc(rules, bytes)) == NULL) > err(EX_OSERR, "realloc"); > i = getsockopt(s, IPPROTO_IPV6, IPV6_FW_GET, rules, &bytes); > if ((i < 0 && errno != EINVAL) || nalloc > maxbytes) > err(EX_OSERR, "getsockopt(IPV6_FW_GET)"); > } > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message