setsockopt() can not remove the accept filter

Maxim Konovalov maxim at FreeBSD.org
Sat Jun 11 12:05:09 GMT 2005


Igor,

On Sat, 11 Jun 2005, 02:12+0400, Igor Sysoev wrote:

> Hi,
>
> man setsockopt(2) states that "passing in an optval of NULL will remove
> the filter", however, setsockopt() always return EINVAL in this case,
> because do_setopt_accept_filter() removes the filter if sopt == NULL, but
> not if sopt->val == NULL.  The fix is easy:
>
> -        if (sopt == NULL) {
> +        if (sopt == NULL || sopt->val == NULL) {

I committed fixes for this and related bug and will MFC them in two
weeks.  Thanks!

-- 
Maxim Konovalov


More information about the freebsd-net mailing list