summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/ChangeLog2
-rw-r--r--nuttx/include/nuttx/net/net.h2
-rw-r--r--nuttx/include/nuttx/net/uip/uip-tcp.h2
-rw-r--r--nuttx/net/Kconfig2
-rw-r--r--nuttx/net/net_clone.c7
-rw-r--r--nuttx/net/net_send_buffered.c8
-rw-r--r--nuttx/net/socket.c7
-rw-r--r--nuttx/net/uip/uip_tcpwrbuffer.c2
8 files changed, 19 insertions, 13 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 9c08ef7c7..68640e5a3 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -6436,4 +6436,6 @@
in the PX4 GIT repository.
* fs/fat/fs_fat32.c: A correction to FAT cluster allocation from
Tridge via Lorenz Meier (2014-1-14).
+ * net/net_clone.c: Need to clone fields for TCP write buffering
+ as well (2014-1-14).
diff --git a/nuttx/include/nuttx/net/net.h b/nuttx/include/nuttx/net/net.h
index dffa47592..46858b8c5 100644
--- a/nuttx/include/nuttx/net/net.h
+++ b/nuttx/include/nuttx/net/net.h
@@ -106,7 +106,7 @@ struct socket
FAR void *s_conn; /* Connection: struct uip_conn or uip_udp_conn */
-#ifdef CONFIG_NET_NTCP_WRITE_BUFFERS
+#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
/* Callback instance for TCP send */
FAR struct uip_callback_s *s_sndcb;
diff --git a/nuttx/include/nuttx/net/uip/uip-tcp.h b/nuttx/include/nuttx/net/uip/uip-tcp.h
index 55d281cc0..001ae088e 100644
--- a/nuttx/include/nuttx/net/uip/uip-tcp.h
+++ b/nuttx/include/nuttx/net/uip/uip-tcp.h
@@ -162,7 +162,7 @@ struct uip_conn
uint16_t mss; /* Current maximum segment size for the
* connection */
uint16_t winsize; /* Current window size of the connection */
-#ifdef CONFIG_NET_NTCP_WRITE_BUFFERS
+#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
uint32_t unacked; /* Number bytes sent but not yet ACKed */
#else
uint16_t unacked; /* Number bytes sent but not yet ACKed */
diff --git a/nuttx/net/Kconfig b/nuttx/net/Kconfig
index 83b72cb71..b15b7ee9a 100644
--- a/nuttx/net/Kconfig
+++ b/nuttx/net/Kconfig
@@ -194,7 +194,7 @@ config NET_TCP_RECVDELAY
int "TCP Rx delay"
default 0
---help---
- If NET_NTCP_READAHEAD_BUFFERS is zero, then there will be no buffering
+ If NET_TCP_READAHEAD_BUFFERS is undefined, then there will be no buffering
of TCP/IP packets: Any TCP/IP packet received will be ACKed, but its contents
will be dropped in the bit-bucket.
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 */
diff --git a/nuttx/net/net_send_buffered.c b/nuttx/net/net_send_buffered.c
index a73ceca23..e251c65ac 100644
--- a/nuttx/net/net_send_buffered.c
+++ b/nuttx/net/net_send_buffered.c
@@ -211,7 +211,7 @@ static uint16_t send_interrupt(FAR struct uip_driver_s *dev, FAR void *pvconn,
* so it can be sent as soon as possible.
*/
- while ((entry=sq_remlast(&conn->unacked_q)))
+ while ((entry = sq_remlast(&conn->unacked_q)))
{
struct uip_wrbuffer_s *segment = (struct uip_wrbuffer_s*)entry;
@@ -231,7 +231,7 @@ static uint16_t send_interrupt(FAR struct uip_driver_s *dev, FAR void *pvconn,
* field expired can only be updated at UIP_ESTABLISHED state
*/
- conn->expired ++;
+ conn->expired++;
continue;
}
@@ -338,7 +338,7 @@ static uint16_t send_interrupt(FAR struct uip_driver_s *dev, FAR void *pvconn,
* second interval before expiration.
*/
- segment->wb_nrtx ++;
+ segment->wb_nrtx++;
/* The segment is waiting for ACK again */
@@ -481,7 +481,7 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len,
while (completed < len)
{
- struct uip_wrbuffer_s *segment = uip_tcpwrbuffer_alloc(NULL);
+ FAR struct uip_wrbuffer_s *segment = uip_tcpwrbuffer_alloc(NULL);
if (segment)
{
size_t cnt;
diff --git a/nuttx/net/socket.c b/nuttx/net/socket.c
index 910154de9..7b8db0c05 100644
--- a/nuttx/net/socket.c
+++ b/nuttx/net/socket.c
@@ -158,9 +158,6 @@ int psock_socket(int domain, int type, int protocol, FAR struct socket *psock)
DEBUGASSERT(conn->crefs == 0);
psock->s_conn = conn;
conn->crefs = 1;
-#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
- psock->s_sndcb = NULL;
-#endif
}
}
break;
@@ -193,7 +190,7 @@ int psock_socket(int domain, int type, int protocol, FAR struct socket *psock)
break;
}
- /* Did we succesfully allocate some kind of connection structure? */
+ /* Did we successfully allocate some kind of connection structure? */
if (!psock->s_conn)
{
@@ -205,7 +202,7 @@ int psock_socket(int domain, int type, int protocol, FAR struct socket *psock)
return OK;
errout:
- errno = err;
+ set_errno(err);
return ERROR;
}
diff --git a/nuttx/net/uip/uip_tcpwrbuffer.c b/nuttx/net/uip/uip_tcpwrbuffer.c
index b562b894c..c729dd4b8 100644
--- a/nuttx/net/uip/uip_tcpwrbuffer.c
+++ b/nuttx/net/uip/uip_tcpwrbuffer.c
@@ -162,4 +162,4 @@ void uip_tcpwrbuffer_release(FAR struct uip_wrbuffer_s *wrbuffer)
sem_post(&g_wrbuffer.sem);
}
-#endif /* CONFIG_NET && CONFIG_NET_TCP && CONFIG_NET_NTCP_WRITE_BUFFERS */
+#endif /* CONFIG_NET && CONFIG_NET_TCP && CONFIG_NET_TCP_WRITE_BUFFERS */