summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/ChangeLog7
-rw-r--r--nuttx/Documentation/NuttX.html6
-rw-r--r--nuttx/net/net_clone.c1
-rw-r--r--nuttx/net/uip/uip_tcpinput.c2
4 files changed, 16 insertions, 0 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 90ed1ba08..d7c7753ce 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -872,3 +872,10 @@
stdout to output debug data. That works fine unless (1) the dbg() macro
is interrupt logic and the interrupted task has redirected stdout! Most
changes were in uIP.
+ * net/uip/uip_tcpinput.c. Connection reference count was not being set correctly
+ when a socket is created by accepting a new connection. Since the reference
+ count is bad, such sockets are not successfully duplicated when being passed
+ to new tasks.
+ * net/net_clone.c. Similarly, after a socket is cloned, its reference count
+ was not being initialized.
+
diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html
index 121ba36a5..834ba4075 100644
--- a/nuttx/Documentation/NuttX.html
+++ b/nuttx/Documentation/NuttX.html
@@ -1532,6 +1532,12 @@ nuttx-0.4.11 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
* Changed lots of occurrents of debug macro dbg() to lldbg(). dbg() uses
stdout to output debug data. That works fine unless (1) the dbg() macro
is interrupt logic and the interrupted task has redirected stdout! Most
+ * net/uip/uip_tcpinput.c. Connection reference count was not being set correctly
+ when a socket is created by accepting a new connection. Since the reference
+ count is bad, such sockets are not successfully duplicated when being passed
+ to new tasks.
+ * net/net_clone.c. Similarly, after a socket is cloned, its reference count
+ was not being initialized.
pascal-0.1.3 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
diff --git a/nuttx/net/net_clone.c b/nuttx/net/net_clone.c
index ab5e5a952..313daee24 100644
--- a/nuttx/net/net_clone.c
+++ b/nuttx/net/net_clone.c
@@ -86,6 +86,7 @@ int net_clone(FAR struct socket *psock1, FAR struct socket *psock2)
/* Increment the reference count on the connection */
DEBUGASSERT(psock2->s_conn);
+ psock2->s_crefs = 1; /* One reference on the new socket itself */
#ifdef CONFIG_NET_TCP
if (psock2->s_type == SOCK_STREAM)
diff --git a/nuttx/net/uip/uip_tcpinput.c b/nuttx/net/uip/uip_tcpinput.c
index b1885a093..5f0430ed2 100644
--- a/nuttx/net/uip/uip_tcpinput.c
+++ b/nuttx/net/uip/uip_tcpinput.c
@@ -167,6 +167,8 @@ void uip_tcpinput(struct uip_driver_s *dev)
*/
conn->tcpstateflags = UIP_ESTABLISHED;
+ conn->crefs = 1;
+
if (uip_accept(dev, conn, tmp16) != OK)
{
/* No, then we have to give the connection back */