summaryrefslogtreecommitdiff
path: root/nuttx/net/net_clone.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-01-14 15:17:53 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-01-14 15:17:53 -0600
commitf2587c00c50e212ac9f045a7d80cbfe38ebc0d7b (patch)
tree053097835846a276d074d5670da1c88cc299b0f5 /nuttx/net/net_clone.c
parent0db6e27e1a4db22b079b7216f921836fbcd22665 (diff)
downloadpx4-nuttx-f2587c00c50e212ac9f045a7d80cbfe38ebc0d7b.tar.gz
px4-nuttx-f2587c00c50e212ac9f045a7d80cbfe38ebc0d7b.tar.bz2
px4-nuttx-f2587c00c50e212ac9f045a7d80cbfe38ebc0d7b.zip
When dup'ing sockets, need to clone fields for TCP write buffering too
Diffstat (limited to 'nuttx/net/net_clone.c')
-rw-r--r--nuttx/net/net_clone.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/nuttx/net/net_clone.c b/nuttx/net/net_clone.c
index b58c7e1c6..5efed0944 100644
--- a/nuttx/net/net_clone.c
+++ b/nuttx/net/net_clone.c
@@ -78,9 +78,16 @@ int net_clone(FAR struct socket *psock1, FAR struct socket *psock2)
#ifndef CONFIG_DISABLE_CLOCK
psock2->s_rcvtimeo = psock1->s_rcvtimeo; /* Receive timeout value (in deciseconds) */
psock2->s_sndtimeo = psock1->s_sndtimeo; /* Send timeout value (in deciseconds) */
+#ifdef CONFIG_NET_SOLINGER
+ psock2->s_linger = psock1->s_linger; /* Linger timeout value (in deciseconds) */
+#endif
#endif
#endif
psock2->s_conn = psock1->s_conn; /* UDP or TCP connection structure */
+#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
+ psock2->s_sndcb = NULL; /* Force allocation of new callback
+ * instance for TCP send */
+#endif
/* Increment the reference count on the connection */