summaryrefslogtreecommitdiff
path: root/nuttx/drivers/net/vnet.c
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/vnet.c
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/vnet.c')
-rw-r--r--nuttx/drivers/net/vnet.c14
1 files changed, 13 insertions, 1 deletions
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 */