summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-12-21 04:30:49 +0000
committerpeter <peter@FreeBSD.org>2001-12-21 04:30:49 +0000
commitd39f9b45170a78e9b6575fa4c1780fa7dfeda9ed (patch)
tree696ad7faf1bbf2eeae0852c5a1bdef65f1198389 /sys
parent113298f46b83e94f811dd9be3e0b35bdd91e5826 (diff)
downloadFreeBSD-src-d39f9b45170a78e9b6575fa4c1780fa7dfeda9ed.zip
FreeBSD-src-d39f9b45170a78e9b6575fa4c1780fa7dfeda9ed.tar.gz
Avoid an interaction between syncache and accept filters. The syncache
code only passed up the connection to the tcp stack when it was complete, so it went directly into the so_comp (complete) queue. However, with accept filters, there is an additional phase before calling it "complete". Reviewed by: jlemon
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_sockbuf.c2
-rw-r--r--sys/kern/uipc_socket2.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c
index ae6ba02..0c379d9 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 ae6ba02..0c379d9 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;
OpenPOWER on IntegriCloud