Ethernet drivers: Use IFF_IS_IPv4 macro. Cannot rely on the EtherType being set correctly.
This commit is contained in:
parent
aec4528882
commit
92f440c20c
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user