Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Oct 2002 12:26:32 -0700
From:      Luigi Rizzo <rizzo@icir.org>
To:        Andrey Simonenko <simon@simon.org.ua>
Cc:        freebsd-net@FreeBSD.ORG
Subject:   Re: Q about sbin/ip6fw/ip6fw.c:list()
Message-ID:  <20021009122632.A52391@carp.icir.org>
In-Reply-To: <20021007222647.B91626-100000@lion.com.ua>; from simon@simon.org.ua on Mon, Oct 07, 2002 at 11:29:50PM %2B0300
References:  <20021007222647.B91626-100000@lion.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021009122632.A52391>