diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index ae6ba020dfa8..0c379d9c191a 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -225,6 +225,8 @@ sonewconn(head, connstatus) so = soalloc(0); if (so == NULL) return ((struct socket *)0); + if ((head->so_options & SO_ACCEPTFILTER) != 0) + connstatus = 0; so->so_head = head; so->so_type = head->so_type; so->so_options = head->so_options &~ SO_ACCEPTCONN; diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index ae6ba020dfa8..0c379d9c191a 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -225,6 +225,8 @@ sonewconn(head, connstatus) so = soalloc(0); if (so == NULL) return ((struct socket *)0); + if ((head->so_options & SO_ACCEPTFILTER) != 0) + connstatus = 0; so->so_head = head; so->so_type = head->so_type; so->so_options = head->so_options &~ SO_ACCEPTCONN;