Fix missing ARP entry problem

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3139 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2010-11-27 23:15:39 +00:00
parent a6c935e127
commit dcc9abe19b
3 changed files with 40 additions and 7 deletions
+7
View File
@@ -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.
+6
View File
@@ -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>
+27 -7
View File
@@ -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