diff --git a/net/arp/arp_out.c b/net/arp/arp_out.c index ac8f6651be..df107c0849 100644 --- a/net/arp/arp_out.c +++ b/net/arp/arp_out.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/arp/arp_out.c * - * Copyright (C) 2007-2011, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2011, 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Based on uIP which also has a BSD style license: @@ -144,11 +144,11 @@ void arp_out(FAR struct net_driver_s *dev) * written into a packet socket. */ - if ((dev->d_flags & IFF_NOARP) != 0) + if (IFF_IS_NOARP(dev->d_flags)) { /* Clear the indication and let the packet continue on its way. */ - dev->d_flags &= ~IFF_NOARP; + IFF_CLR_IPv6(dev->d_flags); return; } #endif diff --git a/net/arp/arp_send.c b/net/arp/arp_send.c index 0bbcf382f2..1885f19ba0 100644 --- a/net/arp/arp_send.c +++ b/net/arp/arp_send.c @@ -134,7 +134,7 @@ static uint16_t arp_send_interrupt(FAR struct net_driver_s *dev, * flag will be cleared in arp_out(). */ - dev->d_flags |= IFF_NOARP; + IFF_SET_NOARP(dev->d_flags); /* Don't allow any further call backs. */ diff --git a/net/icmpv6/icmpv6_input.c b/net/icmpv6/icmpv6_input.c index cb504f096c..0d7a629d23 100644 --- a/net/icmpv6/icmpv6_input.c +++ b/net/icmpv6/icmpv6_input.c @@ -279,6 +279,10 @@ void icmpv6_input(FAR struct net_driver_s *dev) goto typeerr; } + /* No additional neighbor lookup is required on this packet. */ + + IFF_SET_NOARP(dev->d_flags); + nllvdbg("Outgoing ICMPv6 packet length: %d (%d)\n", dev->d_len, (icmp->len[0] << 8) | icmp->len[1]); diff --git a/net/icmpv6/icmpv6_solicit.c b/net/icmpv6/icmpv6_solicit.c index c0732c922b..25da9bf415 100644 --- a/net/icmpv6/icmpv6_solicit.c +++ b/net/icmpv6/icmpv6_solicit.c @@ -180,6 +180,16 @@ void icmpv6_solicit(FAR struct net_driver_s *dev, /* Move our source Ethernet addresses into the Ethernet header */ memcpy(eth->src, dev->d_mac.ether_addr_octet, ETHER_ADDR_LEN); + +#if 0 + /* No additional neighbor lookup is required on this packet. + * REVISIT: It is inappropriate to set this bit if we get here + * via neighbor_out(); It is no necessary to set this bit if we + * get here via icmpv6_input(). Is it ever necessary? + */ + + IFF_SET_NOARP(dev->d_flags); +#endif } #endif diff --git a/net/neighbor/neighbor_out.c b/net/neighbor/neighbor_out.c index 94cad10d2a..c987b79e13 100644 --- a/net/neighbor/neighbor_out.c +++ b/net/neighbor/neighbor_out.c @@ -131,19 +131,18 @@ void neighbor_out(FAR struct net_driver_s *dev) FAR struct ipv6_hdr_s *ip = IPv6BUF; net_ipv6addr_t ipaddr; -#if defined(CONFIG_NET_PKT) || defined(CONFIG_NET_NEIGHBOR_SEND) /* Skip sending ARP requests when the frame to be transmitted was - * written into a packet socket. + * written into a packet socket or if we are sending certain Neighbor + * messages (soliciation, advertisement, echo request). */ - if ((dev->d_flags & IFF_NOARP) != 0) + if (IFF_IS_NOARP(dev->d_flags)) { /* Clear the indication and let the packet continue on its way. */ - dev->d_flags &= ~IFF_NOARP; + IFF_CLR_IPv6(dev->d_flags); return; } -#endif /* Find the destination IPv6 address in the ARP table and construct * the Ethernet header. If the destination IPv6 address isn't on the diff --git a/net/pkt/pkt_send.c b/net/pkt/pkt_send.c index 5c352e8502..433f7aeb7f 100644 --- a/net/pkt/pkt_send.c +++ b/net/pkt/pkt_send.c @@ -132,7 +132,7 @@ static uint16_t psock_send_interrupt(FAR struct net_driver_s *dev, * flag will be cleared in arp_out(). */ - dev->d_flags |= IFF_NOARP; + IFF_SET_NOARP(dev->d_flags); } /* Don't allow any further call backs. */