From owner-freebsd-net Mon Oct 7 13:30: 0 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 B6CFB37B401 for ; Mon, 7 Oct 2002 13:29:59 -0700 (PDT) Received: from lion.com.ua (lion.com.ua [213.133.161.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 360C143E6E for ; Mon, 7 Oct 2002 13:29:56 -0700 (PDT) (envelope-from sa@simon.org.ua) Received: from localhost (localhost [127.0.0.1]) by lion.com.ua (8.12.5/8.12.5) with ESMTP id g97KTovI091750 for ; Mon, 7 Oct 2002 23:29:53 +0300 (EEST) (envelope-from sa@simon.org.ua) Date: Mon, 7 Oct 2002 23:29:50 +0300 (EEST) From: Andrey Simonenko X-X-Sender: sa@lion.com.ua To: freebsd-net@freebsd.org Subject: Q about sbin/ip6fw/ip6fw.c:list() Message-ID: <20021007222647.B91626-100000@lion.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Hello, Why is it not allowed to get more that 65536 ip6fw rules from the kernel in the ip6fw.c:list() function? 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