diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -3149,6 +3149,16 @@ SOCK_UNLOCK(so); break; + case SO_ERROR: + error = sooptcopyin(sopt, &optval, sizeof optval, + sizeof optval); + if (error) + goto bad; + SOCK_LOCK(so); + so->so_error = optval; + SOCK_UNLOCK(so); + break; + case SO_DEBUG: case SO_KEEPALIVE: case SO_DONTROUTE: