Networking: Modify all Ethernet drivers: Do neighbor look-up on all outgoing IPv6 packs in order to properly set the destination link layer address.

This commit is contained in:
Gregory Nutt 2015-01-20 15:52:25 -06:00
parent f6063c3896
commit 723b7fc430
14 changed files with 185 additions and 18 deletions

View File

@ -1271,6 +1271,12 @@ static void c5471_receive(struct c5471_driver_s *c5471)
{
arp_out(dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(dev);
}
#endif
/* And send the packet */
@ -1297,13 +1303,19 @@ static void c5471_receive(struct c5471_driver_s *c5471)
if (dev->d_len > 0 &&
(EIM_TXDESC_OWN_HOST & getreg32(c5471->c_rxcpudesc)) == 0)
{
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv4
if (IFF_IS_IPv4(dev->d_flags))
{
arp_out(dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(dev);
}
#endif
/* And send the packet */

View File

@ -552,6 +552,12 @@ static void kinetis_receive(FAR struct kinetis_driver_s *priv)
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
@ -575,13 +581,19 @@ static void kinetis_receive(FAR struct kinetis_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 */

View File

@ -914,6 +914,12 @@ static void lpc17_rxdone(struct lpc17_driver_s *priv)
{
arp_out(&priv->lp_dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->lp_dev);
}
#endif
/* And send the packet */
@ -939,13 +945,19 @@ static void lpc17_rxdone(struct lpc17_driver_s *priv)
if (priv->lp_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->lp_dev.d_flags))
{
arp_out(&priv->lp_dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->lp_dev);
}
#endif
/* And send the packet */

View File

@ -1177,6 +1177,12 @@ static void sam_receive(struct sam_emac_s *priv)
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
@ -1200,13 +1206,19 @@ static void sam_receive(struct sam_emac_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 */

View File

@ -1217,6 +1217,12 @@ static void sam_receive(struct sam_emac_s *priv)
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
@ -1240,19 +1246,25 @@ static void sam_receive(struct sam_emac_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 */
/* And send the packet */
sam_transmit(priv);
}
sam_transmit(priv);
}
}
else
#endif

View File

@ -1543,6 +1543,12 @@ static void sam_receive(struct sam_emac_s *priv)
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
@ -1566,13 +1572,19 @@ static void sam_receive(struct sam_emac_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 */

View File

@ -1147,6 +1147,12 @@ static void sam_receive(struct sam_gmac_s *priv)
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
@ -1170,13 +1176,19 @@ static void sam_receive(struct sam_gmac_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 */

View File

@ -1649,6 +1649,12 @@ static void stm32_receive(FAR struct stm32_ethmac_s *priv)
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
@ -1672,13 +1678,19 @@ static void stm32_receive(FAR struct stm32_ethmac_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 */

View File

@ -805,6 +805,12 @@ static void tiva_receive(struct tiva_driver_s *priv)
{
arp_out(&priv->ld_dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->ld_dev);
}
#endif
/* And send the packet */
@ -830,13 +836,19 @@ static void tiva_receive(struct tiva_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->ld_dev.d_flags))
{
arp_out(&priv->ld_dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->ld_dev);
}
#endif
/* And send the packet */

View File

@ -1719,7 +1719,12 @@ static void tiva_receive(FAR struct tiva_ethmac_s *priv)
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
tiva_transmit(priv);
@ -1742,13 +1747,19 @@ static void tiva_receive(FAR struct tiva_ethmac_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 */

View File

@ -294,6 +294,12 @@ static void emac_receive(FAR struct emac_driver_s *priv)
{
arp_out(&priv->d_dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->d_dev);
}
#endif
/* And send the packet */
@ -317,13 +323,19 @@ static void emac_receive(FAR struct emac_driver_s *priv)
if (priv->d_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->d_dev.d_flags))
{
arp_out(&priv->d_dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->d_dev);
}
#endif
/* And send the packet */

View File

@ -1471,6 +1471,12 @@ static void pic32mx_rxdone(struct pic32mx_driver_s *priv)
{
arp_out(&priv->pd_dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->pd_dev);
}
#endif
/* And send the packet */
@ -1496,13 +1502,19 @@ static void pic32mx_rxdone(struct pic32mx_driver_s *priv)
if (priv->pd_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->pd_dev.d_flags))
{
arp_out(&priv->pd_dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&priv->pd_dev);
}
#endif
/* And send the packet */

View File

@ -198,6 +198,12 @@ void netdriver_loop(void)
{
arp_out(&g_sim_dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&g_sim_dev);
}
#endif
/* And send the packet */
@ -222,13 +228,19 @@ void netdriver_loop(void)
if (g_sim_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(g_sim_dev.d_flags))
{
arp_out(&g_sim_dev);
}
else
#endif
#ifdef CONFIG_NET_IPv6
{
neighbor_out(&g_sim_dev);
}
#endif
/* And send the packet */

View File

@ -1307,6 +1307,12 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv)
{
arp_out(&priv->dev);
}
#ifdef CONFIG_NET_IPv6
else
{
neighbor_out(&priv->dev);
}
#endif
/* And send the packet */
@ -1331,13 +1337,19 @@ static int ez80emac_receive(struct ez80emac_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 */