setsockopt() can not remove the accept filter

Igor Sysoev is at rambler-co.ru
Fri Jun 10 22:12:20 GMT 2005


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) {


By the way, is it easy to add timeout for dataready and httpready filters ?
Now the stale connections may live for long time.


Igor Sysoev
http://sysoev.ru/en/


More information about the freebsd-net mailing list