summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-10-11 10:04:54 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-10-11 10:04:54 -0600
commitd474fee7d65e68d3962dea92eee3fb21fef315fc (patch)
tree4c8ce8ab9a9fd0bd0da74c716b5c3afa6e5a4799
parentc000e20484dfc6b334089a9a95bee2c1f765c408 (diff)
downloadnuttx-d474fee7d65e68d3962dea92eee3fb21fef315fc.tar.gz
nuttx-d474fee7d65e68d3962dea92eee3fb21fef315fc.tar.bz2
nuttx-d474fee7d65e68d3962dea92eee3fb21fef315fc.zip
Notify the socket layer if a connection is lost before the monitoring callback has been registered. From Max Holtzberg
-rw-r--r--nuttx/ChangeLog4
-rw-r--r--nuttx/net/net_monitor.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 02c692098..1189fd6d2 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -5742,3 +5742,7 @@
* arch/arm/src/sama5/sam_lcd.c wait before modifying register if the LCDC
is re-synchronizing (SIF). Use start-up configuration settings from
Barebox. They still don't work (2013-10-10).
+ * net/net_monitor.c: Notify the socket layer if a connection is lost
+ before the monitoring callback has been registered. From Max
+ Holtzberg (2013-10-11).
+
diff --git a/nuttx/net/net_monitor.c b/nuttx/net/net_monitor.c
index 12907fa42..3ce092220 100644
--- a/nuttx/net/net_monitor.c
+++ b/nuttx/net/net_monitor.c
@@ -138,7 +138,8 @@ int net_startmonitor(FAR struct socket *psock)
* the monitoring callback.)
*/
- if (conn->tcpstateflags == UIP_CLOSED)
+ if (!(conn->tcpstateflags == UIP_ESTABLISHED ||
+ conn->tcpstateflags == UIP_SYN_RCVD))
{
connection_event(conn, UIP_CLOSE);
}