Net PKT: Suppress ARP requests for packet socket transfers

This commit is contained in:
Gregory Nutt 2014-06-24 08:22:12 -06:00
parent d87b07f419
commit 0520270733
2 changed files with 12 additions and 0 deletions

View File

@ -55,6 +55,7 @@
#define IFF_DOWN (1 << 0) #define IFF_DOWN (1 << 0)
#define IFF_UP (1 << 1) #define IFF_UP (1 << 1)
#define IFF_RUNNING (1 << 2) #define IFF_RUNNING (1 << 2)
#define IFF_NOARP (1 << 7)
/******************************************************************************************* /*******************************************************************************************

View File

@ -327,6 +327,17 @@ void arp_out(struct uip_driver_s *dev)
in_addr_t ipaddr; in_addr_t ipaddr;
in_addr_t destipaddr; in_addr_t destipaddr;
#ifdef CONFIG_NET_PKT
/* Skip sending ARP requests when the frame to be transmitted was
* written into a packet socket.
*/
if ((dev->d_flags & IFF_NOARP) == IFF_NOARP)
{
return;
}
#endif
/* Find the destination IP address in the ARP table and construct /* Find the destination IP address in the ARP table and construct
* the Ethernet header. If the destination IP address isn't on the * the Ethernet header. If the destination IP address isn't on the
* local network, we use the default router's IP address instead. * local network, we use the default router's IP address instead.