indeed you are right -- then one can probably remove the additional check.

        cheers
        luigi

On Thu, Oct 03, 2002 at 10:04:41PM +0300, Andrey Simonenko wrote:
...
> Why is it possible that getsockopt(IP_FW_GET) can return not all IPFW2
> rules? According to ipfw(8) manual page there is always a rule 65535, so
> this rule should be always present after getsockopt(IP_FW_GET) call (of
> course there should be enought memory in a buffer, but it is checked in
> the code of list() function):
> 
>       /* get rules or pipes from kernel, resizing array as necessary */
>       nbytes = nalloc;
> 
>       while (nbytes >= nalloc) {
>               nalloc = nalloc * 2 + 200;
>               nbytes = nalloc;
>               if ((data = realloc(data, nbytes)) == NULL)
>                       err(EX_OSERR, "realloc");
>               if (getsockopt(s, IPPROTO_IP, ocmd, data, &nbytes) < 0)
>                       err(EX_OSERR, "getsockopt(IP_%s_GET)",
>                               do_pipe ? "DUMMYNET" : "FW");
>       }
> 
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-net" in the body of the message

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message

Reply via email to