mirror of
https://github.com/apache/nuttx.git
synced 2026-09-27 10:46:02 +08:00
Armv7-M: Remove Px4-only setting of stack to 0xff. This is incompatible with standard NuttX stack montitoring logic
This commit is contained in:
+68
-18
@@ -66,6 +66,7 @@
|
||||
#include "netdev/netdev.h"
|
||||
#include "devif/devif.h"
|
||||
#include "arp/arp.h"
|
||||
#include "neighbor/neighbor.h"
|
||||
#include "tcp/tcp.h"
|
||||
#include "socket/socket.h"
|
||||
|
||||
@@ -232,6 +233,69 @@ static uint16_t ack_interrupt(FAR struct net_driver_s *dev, FAR void *pvconn,
|
||||
return flags;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: sendfile_addrcheck
|
||||
*
|
||||
* Description:
|
||||
* Check if the destination IP address is in the IPv4 ARP or IPv6 Neighbor
|
||||
* tables. If not, then the send won't actually make it out... it will be
|
||||
* replaced with an ARP request (IPv4) or a Neighbor Solicitation (IPv6).
|
||||
*
|
||||
* NOTE 1: This could be an expensive check if there are a lot of
|
||||
* entries in the ARP or Neighbor tables.
|
||||
*
|
||||
* NOTE 2: If we are actually harvesting IP addresses on incoming IP
|
||||
* packets, then this check should not be necessary; the MAC mapping
|
||||
* should already be in the ARP table in many cases (IPv4 only).
|
||||
*
|
||||
* NOTE 3: If CONFIG_NET_ARP_SEND then we can be assured that the IP
|
||||
* address mapping is already in the ARP table.
|
||||
*
|
||||
* Parameters:
|
||||
* conn - The TCP connection structure
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
* Assumptions:
|
||||
* Running at the interrupt level
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_ETHERNET
|
||||
static inline bool sendfile_addrcheck(FAR struct tcp_conn_s *conn)
|
||||
{
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
if (conn->domain == PF_INET)
|
||||
#endif
|
||||
{
|
||||
#if !defined(CONFIG_NET_ARP_IPIN) && !defined(CONFIG_NET_ARP_SEND)
|
||||
return (arp_find(conn->u.ipv4.raddr) != NULL);
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
#endif /* CONFIG_NET_IPv4 */
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#if !defined(CONFIG_NET_ICMPv6_SEND)
|
||||
return (neighbor_findentry(conn->u.ipv6.raddr) != NULL);
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
#endif /* CONFIG_NET_IPv6 */
|
||||
}
|
||||
|
||||
#else /* CONFIG_NET_ETHERNET */
|
||||
# sendfile_addrcheck(r) (true)
|
||||
#endif /* CONFIG_NET_ETHERNET */
|
||||
|
||||
/****************************************************************************
|
||||
* Function: sendfile_interrupt
|
||||
*
|
||||
@@ -337,26 +401,12 @@ static uint16_t sendfile_interrupt(FAR struct net_driver_s *dev, FAR void *pvcon
|
||||
|
||||
tcp_setsequence(conn->sndseq, seqno);
|
||||
|
||||
/* 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 1: This could be an expensive check if there are a lot of entries
|
||||
* in the ARP table. Hence, we only check on the first packet -- when
|
||||
* snd_sent is zero.
|
||||
*
|
||||
* NOTE 2: If we are actually harvesting IP addresses on incoming IP
|
||||
* packets, then this check should not be necessary; the MAC mapping
|
||||
* should already be in the ARP table in many cases.
|
||||
*
|
||||
* NOTE 3: If CONFIG_NET_ARP_SEND then we can be assured that the IP
|
||||
* address mapping is already in the ARP table.
|
||||
/* Check if the destination IP address is in the ARP or Neighbor
|
||||
* table. If not, then the send won't actually make it out... it
|
||||
* will be replaced with an ARP request or Neighbor Solicitation.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_NET_ETHERNET) && !defined(CONFIG_NET_ARP_IPIN) && \
|
||||
!defined(CONFIG_NET_ARP_SEND)
|
||||
if (pstate->snd_sent != 0 || arp_find(conn->u.ipv4.raddr) != NULL)
|
||||
#endif
|
||||
if (pstate->snd_sent != 0 || sendfile_addrcheck(conn))
|
||||
{
|
||||
/* Update the amount of data sent (but not necessarily ACKed) */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user