summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-11-27 23:15:39 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-11-27 23:15:39 +0000
commit7f5b9991bf8580a9c155dfd42423430c11c62fd8 (patch)
tree3c8ab897b5851ba12934cfca006588767786c474
parent2268aea37d7eca8d6aeeaa6c3f540088329ed3b1 (diff)
downloadnuttx-7f5b9991bf8580a9c155dfd42423430c11c62fd8.tar.gz
nuttx-7f5b9991bf8580a9c155dfd42423430c11c62fd8.tar.bz2
nuttx-7f5b9991bf8580a9c155dfd42423430c11c62fd8.zip
Fix missing ARP entry problem
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3139 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/ChangeLog7
-rw-r--r--nuttx/Documentation/NuttX.html6
-rw-r--r--nuttx/net/send.c34
3 files changed, 40 insertions, 7 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index f79e44d86..8db65a1e1 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -1362,4 +1362,11 @@
5.15 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
+ * net/uip/uip_tcpaddsend.c and net/send.c -- Another place where the TCP sequence
+ number problem "fixed" in 5.14 might occur.
+ * net/send.c -- Check if the destination IP address is in the ARP table. If
+ not, then don't consider the packet sent. It won't be, an ARP packet will go
+ out instead.
+
+
diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html
index 4522d860a..b150f99d6 100644
--- a/nuttx/Documentation/NuttX.html
+++ b/nuttx/Documentation/NuttX.html
@@ -1983,6 +1983,12 @@ buildroot-1.8 2009-12-21 &lt;spudmonkey@racsa.co.cr&gt;
<ul><pre>
nuttx-5.15 2010-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
+ * net/uip/uip_tcpaddsend.c and net/send.c -- Another place where the TCP sequence
+ number problem "fixed" in 5.14 might occur.
+ * net/send.c -- Check if the destination IP address is in the ARP table. If
+ not, then don't consider the packet sent. It won't be, an ARP packet will go
+ out instead.
+
pascal-2.1 2010-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
buildroot-1.9 2010-xx-xx <spudmonkey@racsa.co.cr>
diff --git a/nuttx/net/send.c b/nuttx/net/send.c
index 480627a14..515c350e4 100644
--- a/nuttx/net/send.c
+++ b/nuttx/net/send.c
@@ -51,6 +51,10 @@
#include <nuttx/clock.h>
#include <net/uip/uip-arch.h>
+#ifndef CONFIG_NET_ARP_IPIN
+# include <net/uip/uip-arp.h>
+#endif
+
#include "net_internal.h"
#include "uip/uip_internal.h"
@@ -255,21 +259,37 @@ static uint16_t send_interrupt(struct uip_driver_s *dev, void *pvconn,
nllvdbg("SEND: sndseq %08x->%08x\n", conn->sndseq, seqno);
uip_tcpsetsequence(conn->sndseq, seqno);
- /* Then send that amount of data */
+ /* Then set-up to send that amount of data. (this won't actually
+ * happen until the polling cycle completes).
+ */
uip_send(dev, &pstate->snd_buffer[pstate->snd_sent], sndlen);
- /* And update the amount of data sent (but not necessarily ACKed) */
+ /* Check if the destination IP address is in the ARP table. If not,
+ * then the send won't actually make it out... it will be replaced with
+ * an ARP request.
+ *
+ * NOTE: If we are actually harvesting IP addresses on incomming IP
+ * packets, then this check should be necessary; the MAC mapping should
+ * already be in the ARP table.
+ */
- pstate->snd_sent += sndlen;
- nllvdbg("SEND: acked=%d sent=%d buflen=%d\n",
- pstate->snd_acked, pstate->snd_sent, pstate->snd_buflen);
+#ifndef CONFIG_NET_ARP_IPIN
+ if (uip_arp_find(conn->ripaddr) != NULL)
+#endif
+ {
+ /* Update the amount of data sent (but not necessarily ACKed) */
- /* Update the send time */
+ pstate->snd_sent += sndlen;
+ nllvdbg("SEND: acked=%d sent=%d buflen=%d\n",
+ pstate->snd_acked, pstate->snd_sent, pstate->snd_buflen);
+
+ /* Update the send time */
#if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
- pstate->snd_time = g_system_timer;
+ pstate->snd_time = g_system_timer;
#endif
+ }
}
/* All data has been send and we are just waiting for ACK or re-tranmist