mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
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:
@@ -1362,4 +1362,11 @@
|
|||||||
|
|
||||||
5.15 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1983,6 +1983,12 @@ buildroot-1.8 2009-12-21 <spudmonkey@racsa.co.cr>
|
|||||||
<ul><pre>
|
<ul><pre>
|
||||||
nuttx-5.15 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
nuttx-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.
|
||||||
|
|
||||||
pascal-2.1 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
pascal-2.1 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
|
||||||
buildroot-1.9 2010-xx-xx <spudmonkey@racsa.co.cr>
|
buildroot-1.9 2010-xx-xx <spudmonkey@racsa.co.cr>
|
||||||
|
|||||||
+27
-7
@@ -51,6 +51,10 @@
|
|||||||
#include <nuttx/clock.h>
|
#include <nuttx/clock.h>
|
||||||
#include <net/uip/uip-arch.h>
|
#include <net/uip/uip-arch.h>
|
||||||
|
|
||||||
|
#ifndef CONFIG_NET_ARP_IPIN
|
||||||
|
# include <net/uip/uip-arp.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "net_internal.h"
|
#include "net_internal.h"
|
||||||
#include "uip/uip_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);
|
nllvdbg("SEND: sndseq %08x->%08x\n", conn->sndseq, seqno);
|
||||||
uip_tcpsetsequence(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);
|
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;
|
#ifndef CONFIG_NET_ARP_IPIN
|
||||||
nllvdbg("SEND: acked=%d sent=%d buflen=%d\n",
|
if (uip_arp_find(conn->ripaddr) != NULL)
|
||||||
pstate->snd_acked, pstate->snd_sent, pstate->snd_buflen);
|
#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)
|
#if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
||||||
pstate->snd_time = g_system_timer;
|
pstate->snd_time = g_system_timer;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* All data has been send and we are just waiting for ACK or re-tranmist
|
/* All data has been send and we are just waiting for ACK or re-tranmist
|
||||||
|
|||||||
Reference in New Issue
Block a user