Ethernet drivers: Use IFF_IS_IPv4 macro. Cannot rely on the EtherType being set correctly.

This commit is contained in:
Gregory Nutt
2015-01-20 06:26:14 -06:00
parent 19a71b395c
commit 07132f462f
14 changed files with 28 additions and 28 deletions
+2 -2
View File
@@ -1256,7 +1256,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(dev->d_flags))
#endif
{
arp_out(dev);
@@ -1290,7 +1290,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(dev->d_flags))
{
arp_out(dev);
}
+2 -2
View File
@@ -537,7 +537,7 @@ static void kinetis_receive(FAR struct kinetis_driver_s *priv)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
@@ -568,7 +568,7 @@ static void kinetis_receive(FAR struct kinetis_driver_s *priv)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
+2 -2
View File
@@ -897,7 +897,7 @@ static void lpc17_rxdone(struct lpc17_driver_s *priv)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->lp_dev.d_flags))
#endif
{
arp_out(&priv->lp_dev);
@@ -930,7 +930,7 @@ static void lpc17_rxdone(struct lpc17_driver_s *priv)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->lp_dev.d_flags))
{
arp_out(&priv->lp_dev);
}
+2 -2
View File
@@ -1162,7 +1162,7 @@ static void sam_receive(struct sam_emac_s *priv)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
@@ -1193,7 +1193,7 @@ static void sam_receive(struct sam_emac_s *priv)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
+2 -2
View File
@@ -1202,7 +1202,7 @@ static void sam_receive(struct sam_emac_s *priv)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
@@ -1233,7 +1233,7 @@ static void sam_receive(struct sam_emac_s *priv)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
+2 -2
View File
@@ -1528,7 +1528,7 @@ static void sam_receive(struct sam_emac_s *priv)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
@@ -1559,7 +1559,7 @@ static void sam_receive(struct sam_emac_s *priv)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
+2 -2
View File
@@ -1132,7 +1132,7 @@ static void sam_receive(struct sam_gmac_s *priv)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
@@ -1163,7 +1163,7 @@ static void sam_receive(struct sam_gmac_s *priv)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
+2 -2
View File
@@ -1638,7 +1638,7 @@ static void stm32_receive(FAR struct stm32_ethmac_s *priv)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
@@ -1669,7 +1669,7 @@ static void stm32_receive(FAR struct stm32_ethmac_s *priv)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
+2 -2
View File
@@ -790,7 +790,7 @@ static void tiva_receive(struct tiva_driver_s *priv)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (ETHBUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->ld_dev.d_flags))
#endif
{
arp_out(&priv->ld_dev);
@@ -823,7 +823,7 @@ static void tiva_receive(struct tiva_driver_s *priv)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (ETHBUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->ld_dev.d_flags))
{
arp_out(&priv->ld_dev);
}
+2 -2
View File
@@ -1714,7 +1714,7 @@ static void tiva_receive(FAR struct tiva_ethmac_s *priv)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
@@ -1745,7 +1745,7 @@ static void tiva_receive(FAR struct tiva_ethmac_s *priv)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}
+2 -2
View File
@@ -279,7 +279,7 @@ static void emac_receive(FAR struct emac_driver_s *priv)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->d_dev.d_flags))
#endif
{
arp_out(&priv->d_dev);
@@ -310,7 +310,7 @@ static void emac_receive(FAR struct emac_driver_s *priv)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->d_dev.d_flags))
{
arp_out(&priv->d_dev);
}
+2 -2
View File
@@ -1454,7 +1454,7 @@ static void pic32mx_rxdone(struct pic32mx_driver_s *priv)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->pd_dev.d_flags))
#endif
{
arp_out(&priv->pd_dev);
@@ -1487,7 +1487,7 @@ static void pic32mx_rxdone(struct pic32mx_driver_s *priv)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->pd_dev.d_flags))
{
arp_out(&priv->pd_dev);
}
+2 -2
View File
@@ -181,7 +181,7 @@ void netdriver_loop(void)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(g_sim_dev.d_flags))
#endif
{
arp_out(&g_sim_dev);
@@ -213,7 +213,7 @@ void netdriver_loop(void)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (BUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(g_sim_dev.d_flags))
{
arp_out(&g_sim_dev);
}
+2 -2
View File
@@ -1292,7 +1292,7 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv)
/* Update the Ethernet header with the correct MAC address */
#ifdef CONFIG_NET_IPv6
if (ETHBUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
#endif
{
arp_out(&priv->dev);
@@ -1324,7 +1324,7 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv)
#ifdef CONFIG_NET_IPv4
/* Update the Ethernet header with the correct MAC address */
if (ETHBUF->type == HTONS(ETHTYPE_IP))
if (IFF_IS_IPv4(priv->dev.d_flags))
{
arp_out(&priv->dev);
}