Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103828814
D41412.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41412.diff
View Options
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
@@ -750,7 +750,19 @@
}
so->so_listen = head;
so->so_type = head->so_type;
- so->so_options = head->so_options & ~SO_ACCEPTCONN;
+ /*
+ * POSIX is ambiguous on what options an accept(2)ed socket should
+ * inherit from the listener. Words "create a new socket" may be
+ * interpreted as not inheriting anything. Best programming practice
+ * for application developers is to not rely on such inheritance.
+ * FreeBSD had historically inherited all so_options excluding
+ * SO_ACCEPTCONN, which virtually means all SOL_SOCKET level options,
+ * including those completely irrelevant to a new born socket. For
+ * compatibility with older versions we will inherit a list of
+ * meaningful options.
+ */
+ so->so_options = head->so_options & (SO_KEEPALIVE | SO_DONTROUTE |
+ SO_LINGER | SO_OOBINLINE | SO_NOSIGPIPE);
so->so_linger = head->so_linger;
so->so_state = head->so_state;
so->so_fibnum = head->so_fibnum;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 11:45 PM (21 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14952969
Default Alt Text
D41412.diff (1 KB)
Attached To
Mode
D41412: sockets: on accept(2) don't copy all of so_options to new socket
Attached
Detach File
Event Timeline
Log In to Comment