summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-02-25 16:41:11 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-02-25 16:41:11 -0600
commit9dcce886a413a43def88b254eaad545bd16e9f9d (patch)
treeb8d2499845460fe217e06e0d29e7045f8aec4ffd
parentd56d58f94575ce871558a43dd01b73c4d976bbfe (diff)
downloadnuttx-9dcce886a413a43def88b254eaad545bd16e9f9d.tar.gz
nuttx-9dcce886a413a43def88b254eaad545bd16e9f9d.tar.bz2
nuttx-9dcce886a413a43def88b254eaad545bd16e9f9d.zip
networking: Fix one place where the reference count was not being zeroed. This is really a cosmetic fix UNLESS CONFIG_DEBUG_NET is enabled, then it causes assertions
-rw-r--r--apps/examples/nettest/Kconfig3
-rw-r--r--apps/examples/nettest/nettest_server.c9
-rw-r--r--nuttx/ChangeLog4
-rw-r--r--nuttx/configs/stm3240g-eval/src/stm3240g-internal.h12
-rw-r--r--nuttx/configs/stm3240g-eval/src/up_autoleds.c4
-rw-r--r--nuttx/configs/stm3240g-eval/src/up_boot.c2
-rw-r--r--nuttx/net/net_close.c1
7 files changed, 27 insertions, 8 deletions
diff --git a/apps/examples/nettest/Kconfig b/apps/examples/nettest/Kconfig
index 613b8ea91..c502b8864 100644
--- a/apps/examples/nettest/Kconfig
+++ b/apps/examples/nettest/Kconfig
@@ -51,6 +51,7 @@ config EXAMPLES_NETTEST_CLIENTIP
EXAMPLES_NETTEST_CLIENTIP should be the same as
EXAMPLES_NETTEST_IPADDR (default). If the target is the server,
then the default value of EXAMPLES_NETTEST_CLIENTIP is set to the
- gateway address, EXAMPLES_NETTEST_DRIPADDR.
+ host PC IP address (possibly the gateway address,
+ EXAMPLES_NETTEST_DRIPADDR?).
endif
diff --git a/apps/examples/nettest/nettest_server.c b/apps/examples/nettest/nettest_server.c
index 5757a778a..ffa021286 100644
--- a/apps/examples/nettest/nettest_server.c
+++ b/apps/examples/nettest/nettest_server.c
@@ -134,10 +134,11 @@ void recv_server(void)
/* Configure to "linger" until all data is sent when the socket is closed */
#ifdef NETTEST_HAVE_SOLINGER
- ling.l_onoff = 1;
- ling.l_linger = 30; /* timeout is seconds */
- if (setsockopt(acceptsd, SOL_SOCKET, SO_LINGER, &ling, sizeof(struct linger)) < 0)
- {
+ ling.l_onoff = 1;
+ ling.l_linger = 30; /* timeout is seconds */
+
+ if (setsockopt(acceptsd, SOL_SOCKET, SO_LINGER, &ling, sizeof(struct linger)) < 0)
+ {
message("server: setsockopt SO_LINGER failure: %d\n", errno);
goto errout_with_acceptsd;
}
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 9e7f9c554..c5f43204d 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -6665,3 +6665,7 @@
sys/types.h. stdef.h is the correct location for the definition, but
it includes sys/types.h so, at least for now, the definition will be
retained in sys/types.h (2014-2-25).
+ * net/net_close.c: Fix one place where the connection reference count
+ was not being decremented. This is really a cosmetic change BUT
+ when CONFIG_DEBUG_NET is enable, it will cause assertions (2014-2-25).
+
diff --git a/nuttx/configs/stm3240g-eval/src/stm3240g-internal.h b/nuttx/configs/stm3240g-eval/src/stm3240g-internal.h
index 8db3def21..3d6e522f0 100644
--- a/nuttx/configs/stm3240g-eval/src/stm3240g-internal.h
+++ b/nuttx/configs/stm3240g-eval/src/stm3240g-internal.h
@@ -243,6 +243,18 @@ int stm32_usbhost_initialize(void);
#endif
/****************************************************************************************************
+ * Name: stm32_led_initialize
+ *
+ * Description:
+ * Initialize LEDs
+ *
+ ****************************************************************************************************/
+
+#ifdef CONFIG_ARCH_LEDS
+void stm32_autoled_initialize(void);
+#endif
+
+/****************************************************************************************************
* Name: stm32_extmemgpios
*
* Description:
diff --git a/nuttx/configs/stm3240g-eval/src/up_autoleds.c b/nuttx/configs/stm3240g-eval/src/up_autoleds.c
index 5e2cc44de..09e527cc6 100644
--- a/nuttx/configs/stm3240g-eval/src/up_autoleds.c
+++ b/nuttx/configs/stm3240g-eval/src/up_autoleds.c
@@ -224,10 +224,10 @@ static void led_setonoff(unsigned int bits)
****************************************************************************/
/****************************************************************************
- * Name: board_led_initialize
+ * Name: stm32_autoled_initialize
****************************************************************************/
-void board_led_initialize(void)
+void stm32_autoled_initialize(void)
{
/* Configure LED1-4 GPIOs for output */
diff --git a/nuttx/configs/stm3240g-eval/src/up_boot.c b/nuttx/configs/stm3240g-eval/src/up_boot.c
index cd184a368..35989f90f 100644
--- a/nuttx/configs/stm3240g-eval/src/up_boot.c
+++ b/nuttx/configs/stm3240g-eval/src/up_boot.c
@@ -239,7 +239,7 @@ void stm32_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
- board_led_initialize();
+ stm32_autoled_initialize();
#endif
}
diff --git a/nuttx/net/net_close.c b/nuttx/net/net_close.c
index 7bec9237c..9e3b7c50a 100644
--- a/nuttx/net/net_close.c
+++ b/nuttx/net/net_close.c
@@ -447,6 +447,7 @@ int psock_close(FAR struct socket *psock)
/* Yes... then perform the disconnection now */
uip_unlisten(conn); /* No longer accepting connections */
+ conn->crefs = 0; /* Discard our reference to the connection */
err = netclose_disconnect(psock); /* Break any current connections */
if (err < 0)
{