network/stack: inherit selected options from the parent socket

similar commit in FreeBSD:
https://github.com/freebsd/freebsd-src/commit/d29b95ecc0d049406d27a6c11939d40a46658733
Change-Id: I370d39c603a3f54158aa2eaf2ad5a30e744beda0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7658
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
Jérôme Duval
2024-05-01 17:54:36 +00:00
committed by Adrien Destugues
parent 91e6e52158
commit d2ac1f5ab2
@@ -648,7 +648,7 @@ socket_spawn_pending(net_socket* _parent, net_socket** _socket)
// inherit parent's properties
socket->send = parent->send;
socket->receive = parent->receive;
socket->options = parent->options & ~SO_ACCEPTCONN;
socket->options = parent->options & (SO_KEEPALIVE | SO_DONTROUTE | SO_LINGER | SO_OOBINLINE);
socket->linger = parent->linger;
socket->owner = parent->owner;
memcpy(&socket->address, &parent->address, parent->address.ss_len);