diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-06-24 08:22:12 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-06-24 08:22:12 -0600 |
commit | e28c4fdc5ad68028d0c8fc6373e2bcce600ddc59 (patch) | |
tree | 8373eea2ba7a765fd0e8ebce5b0bdae053c7829b | |
parent | 153212d74f308104b4cf1c892fa49a27344eec9c (diff) | |
download | nuttx-e28c4fdc5ad68028d0c8fc6373e2bcce600ddc59.tar.gz nuttx-e28c4fdc5ad68028d0c8fc6373e2bcce600ddc59.tar.bz2 nuttx-e28c4fdc5ad68028d0c8fc6373e2bcce600ddc59.zip |
Net PKT: Suppress ARP requests for packet socket transfers
-rw-r--r-- | nuttx/include/net/if.h | 1 | ||||
-rw-r--r-- | nuttx/net/arp/arp_inout.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/nuttx/include/net/if.h b/nuttx/include/net/if.h index 9c1f2a551..eae6bcb3f 100644 --- a/nuttx/include/net/if.h +++ b/nuttx/include/net/if.h @@ -55,6 +55,7 @@ #define IFF_DOWN (1 << 0) #define IFF_UP (1 << 1) #define IFF_RUNNING (1 << 2) +#define IFF_NOARP (1 << 7) /******************************************************************************************* diff --git a/nuttx/net/arp/arp_inout.c b/nuttx/net/arp/arp_inout.c index 78bebae6d..18a1483ca 100644 --- a/nuttx/net/arp/arp_inout.c +++ b/nuttx/net/arp/arp_inout.c @@ -327,6 +327,17 @@ void arp_out(struct uip_driver_s *dev) in_addr_t ipaddr; 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 * the Ethernet header. If the destination IP address isn't on the * local network, we use the default router's IP address instead. |