summaryrefslogtreecommitdiff
path: root/nuttx/net
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-14 18:25:33 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-14 18:25:33 -0600
commitdefc8c9b135e6d13febf7438147da8452477398a (patch)
treecd608e919910dea41b53679d7146cdefc2ce2ebd /nuttx/net
parentb37853d028a2742da5aeeacc27a65bb279ea60d6 (diff)
downloadnuttx-defc8c9b135e6d13febf7438147da8452477398a.tar.gz
nuttx-defc8c9b135e6d13febf7438147da8452477398a.tar.bz2
nuttx-defc8c9b135e6d13febf7438147da8452477398a.zip
ARP: Add support for the case where there are multiple networks: One being Etherenet and the other not (say slip or perhaps someday PPP). In that case, we need to suppress ARP-related operations on the SLIP/PPP interface only
Diffstat (limited to 'nuttx/net')
-rw-r--r--nuttx/net/Kconfig2
-rw-r--r--nuttx/net/arp/Make.defs6
-rw-r--r--nuttx/net/arp/arp_send.c16
3 files changed, 21 insertions, 3 deletions
diff --git a/nuttx/net/Kconfig b/nuttx/net/Kconfig
index c303146ba..85b71c576 100644
--- a/nuttx/net/Kconfig
+++ b/nuttx/net/Kconfig
@@ -120,6 +120,7 @@ config NET_ETHERNET
bool
default y if !NET_SLIP
default n if NET_SLIP
+ select NETDEV_MULTINIC if NET_SLIP
---help---
If NET_SLIP is not selected, then Ethernet will be used (there is
no need to define anything special in the configuration file to use
@@ -128,6 +129,7 @@ config NET_ETHERNET
config NET_SLIP
bool "SLIP support"
default n
+ select NETDEV_MULTINIC if NET_ETHERNET
---help---
Enables building of the SLIP driver. SLIP requires
at least one IP protocol selected and the following additional
diff --git a/nuttx/net/arp/Make.defs b/nuttx/net/arp/Make.defs
index 8132e7ecc..28772a87b 100644
--- a/nuttx/net/arp/Make.defs
+++ b/nuttx/net/arp/Make.defs
@@ -33,9 +33,9 @@
#
############################################################################
-# ARP supported is not provided for SLIP (Ethernet only)
+# ARP support is available for Ethernet only
-ifneq ($(CONFIG_NET_SLIP),y)
+ifeq ($(CONFIG_NET_ETHERNET),y)
NET_CSRCS +=arp_arpin.c arp_out.c arp_format.c arp_table.c arp_timer.c
ifeq ($(CONFIG_NET_ARP_IPIN),y)
@@ -55,4 +55,4 @@ endif
DEPPATH += --dep-path arp
VPATH += :arp
-endif
+endif # CONFIG_NET_ETHERNET
diff --git a/nuttx/net/arp/arp_send.c b/nuttx/net/arp/arp_send.c
index e97156823..c7bbb92c8 100644
--- a/nuttx/net/arp/arp_send.c
+++ b/nuttx/net/arp/arp_send.c
@@ -229,6 +229,22 @@ int arp_send(in_addr_t ipaddr)
goto errout;
}
+ /* If this device does not require ARP bail out. ARP is only built of
+ * CONFIG_NET_ETHERNET is enabled which always requires ARP support. The
+ * following can happening only there multiple network interfaces enabled
+ * (CONFIG_NET_MULTINIC) and one of the interfaces is not Ethernet. At
+ * present, this is possible only if one of the interfaces is SLIP.
+ *
+ * REVISIT: This will need to be extended if PPP is ever incorporated.
+ */
+
+#ifdef CONFIG_NET_SLIP
+ if (dev->d_flags & IFF_NOARP)
+ {
+ return OK;
+ }
+#endif
+
/* Check if the destination address is on the local network. */
if (!net_ipaddr_maskcmp(ipaddr, dev->d_ipaddr, dev->d_netmask))