mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Networking: Apply the same ARP fix for the Neighbor Solicitation logic
This commit is contained in:
+4
-3
@@ -261,8 +261,9 @@ int icmpv6_wait_cancel(FAR struct icmpv6_notify_s *notify);
|
|||||||
* received, or (2) a timeout occurs.
|
* received, or (2) a timeout occurs.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* This function is called from icmpv6_neighbor() and executes in the normal
|
* This function is called from icmpv6_neighbor() and must execute with
|
||||||
* tasking environment.
|
* the network un-locked (interrupts may be disabled to keep the things
|
||||||
|
* stable).
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -283,7 +284,7 @@ int icmpv6_wait(FAR struct icmpv6_notify_s *notify,
|
|||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* This function is called from the MAC device driver indirectly through
|
* This function is called from the MAC device driver indirectly through
|
||||||
* icmpv6_icmpv6in() and may be execute from the interrupt level.
|
* icmpv6_icmpv6in() will execute with the network locked.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -210,6 +210,9 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr)
|
|||||||
struct timespec delay;
|
struct timespec delay;
|
||||||
struct icmpv6_neighbor_s state;
|
struct icmpv6_neighbor_s state;
|
||||||
FAR const uint16_t *lookup;
|
FAR const uint16_t *lookup;
|
||||||
|
#ifdef CONFIG_NET_NOINTS
|
||||||
|
irqstate_t flags;
|
||||||
|
#endif
|
||||||
net_lock_t save;
|
net_lock_t save;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -376,12 +379,21 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr)
|
|||||||
|
|
||||||
/* Now wait for response to the ARP response to be received. The
|
/* Now wait for response to the ARP response to be received. The
|
||||||
* optimal delay would be the work case round trip time.
|
* optimal delay would be the work case round trip time.
|
||||||
|
* NOTE: The network is locked.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
delay.tv_sec = CONFIG_ICMPv6_NEIGHBOR_DELAYSEC;
|
delay.tv_sec = CONFIG_ICMPv6_NEIGHBOR_DELAYSEC;
|
||||||
delay.tv_nsec = CONFIG_ICMPv6_NEIGHBOR_DELAYNSEC;
|
delay.tv_nsec = CONFIG_ICMPv6_NEIGHBOR_DELAYNSEC;
|
||||||
|
|
||||||
|
#ifdef CONFIG_NET_NOINTS
|
||||||
|
flags = irqsave(); /* Keep things stable */
|
||||||
|
net_unlock(save); /* Unlock the network with interrupts disabled */
|
||||||
|
#endif
|
||||||
ret = icmpv6_wait(¬ify, &delay);
|
ret = icmpv6_wait(¬ify, &delay);
|
||||||
|
#ifdef CONFIG_NET_NOINTS
|
||||||
|
save = net_lock(); /* Re-lock the network with interrupts disabled */
|
||||||
|
irqrestore(flags);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* icmpv6_wait will return OK if and only if the matching ARP response
|
/* icmpv6_wait will return OK if and only if the matching ARP response
|
||||||
* is received. Otherwise, it will return -ETIMEDOUT.
|
* is received. Otherwise, it will return -ETIMEDOUT.
|
||||||
|
|||||||
@@ -169,8 +169,9 @@ int icmpv6_wait_cancel(FAR struct icmpv6_notify_s *notify)
|
|||||||
* received, or (2) a timeout occurs.
|
* received, or (2) a timeout occurs.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* This function is called from icmpv6_neighbor() and executes in the normal
|
* This function is called from icmpv6_neighbor() and must execute with
|
||||||
* tasking environment.
|
* the network un-locked (interrupts may be disabled to keep the things
|
||||||
|
* stable).
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -225,7 +226,7 @@ int icmpv6_wait(FAR struct icmpv6_notify_s *notify,
|
|||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* This function is called from the MAC device driver indirectly through
|
* This function is called from the MAC device driver indirectly through
|
||||||
* icmpv6_icmpv6in() and may be execute from the interrupt level.
|
* icmpv6_icmpv6in() will execute with the network locked.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user