PKT sockets: Change how the IFF_NOARP flag is handled. This should be set only when data is moved into the buffer and cleared after tested by the ARP logic. Setting it globally can cause packets to be sent with no valid MAC addresses

This commit is contained in:
Gregory Nutt
2014-08-18 13:42:51 -06:00
parent 1a7e1fb93b
commit ec429fdf00
2 changed files with 12 additions and 11 deletions
+5 -2
View File
@@ -138,13 +138,16 @@ void arp_out(FAR struct net_driver_s *dev)
in_addr_t ipaddr;
in_addr_t destipaddr;
#ifdef CONFIG_NET_PKT
#if defined(CONFIG_NET_PKT) || defined(CONFIG_NET_ARP_SEND)
/* Skip sending ARP requests when the frame to be transmitted was
* written into a packet socket.
*/
if ((dev->d_flags & IFF_NOARP) == IFF_NOARP)
if ((dev->d_flags & IFF_NOARP) != 0)
{
/* Clear the indication and let the packet continue on its way. */
dev->d_flags &= ~IFF_NOARP;
return;
}
#endif