]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
accept_filter: return different errors for non-listener and a busy socket
authorGleb Smirnoff <glebius@FreeBSD.org>
Thu, 25 Apr 2024 04:50:58 +0000 (21:50 -0700)
committerGleb Smirnoff <glebius@FreeBSD.org>
Thu, 25 Apr 2024 04:55:58 +0000 (21:55 -0700)
commit19307b86d31b7dea4bb5c3f7e233ee0e59049258
tree847c0e2223fb1ac8cb05dde7406ab319736fa5c3
parentc68eed82a3dcadf0c826e9e150f59769f4c44f24
accept_filter: return different errors for non-listener and a busy socket

The fact that an accept filter needs to be cleared first before setting to
a different one isn't properly documented.  The requirement that the
socket needs already be listening, although trivial, isn't documented
either.  At least return a more meaningful error than EINVAL for an
existing filter.  Cover this with a test case.
sys/kern/uipc_accf.c
tests/sys/kern/socket_accf.c