summaryrefslogtreecommitdiff
path: root/nuttx/drivers/net
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-20 15:52:25 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-20 15:52:25 -0600
commit3751e9feac6f47085254a5d4f439f5bdd15c722d (patch)
treed90f5a9b54482993017024fd7b5a1d392661c079 /nuttx/drivers/net
parent8869a89a866d3c819baebe183c374d15ee86e62a (diff)
downloadpx4-nuttx-3751e9feac6f47085254a5d4f439f5bdd15c722d.tar.gz
px4-nuttx-3751e9feac6f47085254a5d4f439f5bdd15c722d.tar.bz2
px4-nuttx-3751e9feac6f47085254a5d4f439f5bdd15c722d.zip
Networking: Modify all Ethernet drivers: Do neighbor look-up on all outgoing IPv6 packs in order to properly set the destination link layer address.
Diffstat (limited to 'nuttx/drivers/net')
-rw-r--r--nuttx/drivers/net/cs89x0.c14
-rw-r--r--nuttx/drivers/net/dm90x0.c14
-rw-r--r--nuttx/drivers/net/e1000.c14
-rw-r--r--nuttx/drivers/net/enc28j60.c14
-rw-r--r--nuttx/drivers/net/encx24j600.c14
-rw-r--r--nuttx/drivers/net/skeleton.c14
-rw-r--r--nuttx/drivers/net/vnet.c14
7 files changed, 91 insertions, 7 deletions
diff --git a/nuttx/drivers/net/cs89x0.c b/nuttx/drivers/net/cs89x0.c
index 4002a078b..47d92f782 100644
--- a/nuttx/drivers/net/cs89x0.c
+++ b/nuttx/drivers/net/cs89x0.c
@@ -472,6 +472,12 @@ static void cs89x0_receive(struct cs89x0_driver_s *cs89x0, uint16_t isq)
{
arp_out(&cs89x0->cs_dev);
}
+#ifdef CONFIG_NET_IPv6
+ else
+ {
+ neighbor_out(&s89x0->cs_dev);
+ }
+#endif
/* And send the packet */
@@ -495,13 +501,19 @@ static void cs89x0_receive(struct cs89x0_driver_s *cs89x0, uint16_t isq)
if (cs89x0->cs_dev.d_len > 0)
{
-#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
+#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(cs89x0->cs_dev.d_flags))
{
arp_out(&cs89x0->cs_dev);
}
+ else
+#endif
+#ifdef CONFIG_NET_IPv6
+ {
+ neighbor_out(&cs89x0->cs_dev);
+ }
#endif
/* And send the packet */
diff --git a/nuttx/drivers/net/dm90x0.c b/nuttx/drivers/net/dm90x0.c
index 729cc3baa..c7f7d8b69 100644
--- a/nuttx/drivers/net/dm90x0.c
+++ b/nuttx/drivers/net/dm90x0.c
@@ -1016,6 +1016,12 @@ static void dm9x_receive(struct dm9x_driver_s *dm9x)
{
arp_out(&dm9x->dm_dev);
}
+#ifdef CONFIG_NET_IPv6
+ else
+ {
+ neighbor_out(&dm9x->dm_dev);
+ }
+#endif
/* And send the packet */
@@ -1039,13 +1045,19 @@ static void dm9x_receive(struct dm9x_driver_s *dm9x)
if (dm9x->dm_dev.d_len > 0)
{
-#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
+#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(dm9x->dm_dev.d_flags))
{
arp_out(&dm9x->dm_dev);
}
+ else
+#endif
+#ifdef CONFIG_NET_IPv6
+ {
+ neighbor_out(&dm9x->dm_dev);
+ }
#endif
/* And send the packet */
diff --git a/nuttx/drivers/net/e1000.c b/nuttx/drivers/net/e1000.c
index 543fa93b0..9fc546ec9 100644
--- a/nuttx/drivers/net/e1000.c
+++ b/nuttx/drivers/net/e1000.c
@@ -603,6 +603,12 @@ static void e1000_receive(struct e1000_dev *e1000)
{
arp_out(&e1000->netdev);
}
+#ifdef CONFIG_NET_IPv6
+ else
+ {
+ neighbor_out(&e1000->netdev);
+ }
+#endif
/* And send the packet */
@@ -626,13 +632,19 @@ static void e1000_receive(struct e1000_dev *e1000)
if (e1000->netdev.d_len > 0)
{
-#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
+#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(e1000->netdev.d_flags))
{
arp_out(&e1000->netdev);
}
+ else
+#endif
+#ifdef CONFIG_NET_IPv6
+ {
+ neighbor_out(&e1000->netdev);
+ }
#endif
/* And send the packet */
diff --git a/nuttx/drivers/net/enc28j60.c b/nuttx/drivers/net/enc28j60.c
index 6516250c6..18ec1e449 100644
--- a/nuttx/drivers/net/enc28j60.c
+++ b/nuttx/drivers/net/enc28j60.c
@@ -1412,6 +1412,12 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv)
{
arp_out(&priv->dev);
}
+#ifdef CONFIG_NET_IPv6
+ else
+ {
+ neighbor_out(&priv->dev);
+ }
+#endif
/* And send the packet */
@@ -1435,13 +1441,19 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv)
if (priv->dev.d_len > 0)
{
-#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
+#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
+ else
+#endif
+#ifdef CONFIG_NET_IPv6
+ {
+ neighbor_out(&priv->dev);
+ }
#endif
/* And send the packet */
diff --git a/nuttx/drivers/net/encx24j600.c b/nuttx/drivers/net/encx24j600.c
index e3dd1e8e7..5ed7c2dea 100644
--- a/nuttx/drivers/net/encx24j600.c
+++ b/nuttx/drivers/net/encx24j600.c
@@ -1540,6 +1540,12 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv)
{
arp_out(&priv->dev);
}
+#ifdef CONFIG_NET_IPv6
+ else
+ {
+ neighbor_out(&priv->dev);
+ }
+#endif
/* And send the packet */
@@ -1572,13 +1578,19 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv)
if (priv->dev.d_len > 0)
{
-#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
+#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
+ else
+#endif
+#ifdef CONFIG_NET_IPv6
+ {
+ neighbor_out(&priv->dev);
+ }
#endif
/* And send the packet */
diff --git a/nuttx/drivers/net/skeleton.c b/nuttx/drivers/net/skeleton.c
index 38dc32181..a94234730 100644
--- a/nuttx/drivers/net/skeleton.c
+++ b/nuttx/drivers/net/skeleton.c
@@ -326,6 +326,12 @@ static void skel_receive(FAR struct skel_driver_s *skel)
{
arp_out(&skel->sk_dev);
}
+#ifdef CONFIG_NET_IPv6
+ else
+ {
+ neighbor_out(&kel->sk_dev);
+ }
+#endif
/* And send the packet */
@@ -349,13 +355,19 @@ static void skel_receive(FAR struct skel_driver_s *skel)
if (skel->sk_dev.d_len > 0)
{
-#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
+#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(skel->sk_dev.d_flags))
{
arp_out(&skel->sk_dev);
}
+ else
+#endif
+#ifdef CONFIG_NET_IPv6
+ {
+ neighbor_out(&skel->sk_dev);
+ }
#endif
/* And send the packet */
diff --git a/nuttx/drivers/net/vnet.c b/nuttx/drivers/net/vnet.c
index db1665897..3def6e8d1 100644
--- a/nuttx/drivers/net/vnet.c
+++ b/nuttx/drivers/net/vnet.c
@@ -339,6 +339,12 @@ void rtos_vnet_recv(struct rgmp_vnet *rgmp_vnet, char *data, int len)
{
arp_out(&vnet->sk_dev);
}
+#ifdef CONFIG_NET_IPv6
+ else
+ {
+ neighbor_out(&vnet->sk_dev);
+ }
+#endif
/* And send the packet */
@@ -362,13 +368,19 @@ void rtos_vnet_recv(struct rgmp_vnet *rgmp_vnet, char *data, int len)
if (vnet->sk_dev.d_len > 0)
{
-#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
+#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(vnet->sk_dev.d_flags))
{
arp_out(&vnet->sk_dev);
}
+ else
+#endif
+#ifdef CONFIG_NET_IPv6
+ {
+ neighbor_out(&vnet->sk_dev);
+ }
#endif
/* And send the packet */