mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
Networking: Add missing raw/packet socket support to all Ethernet drivers
This commit is contained in:
+12
-2
@@ -66,6 +66,10 @@
|
||||
#include <nuttx/net/arp.h>
|
||||
#include <nuttx/net/netdev.h>
|
||||
|
||||
#ifdef CONFIG_NET_PKT
|
||||
# include <nuttx/net/pkt.h>
|
||||
#endif
|
||||
|
||||
#include "enc28j60.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -1374,6 +1378,12 @@ static void enc_rxerif(FAR struct enc_driver_s *priv)
|
||||
|
||||
static void enc_rxdispatch(FAR struct enc_driver_s *priv)
|
||||
{
|
||||
#ifdef CONFIG_NET_PKT
|
||||
/* When packet sockets are enabled, feed the frame into the packet tap */
|
||||
|
||||
pkt_input(&priv->dev);
|
||||
#endif
|
||||
|
||||
/* We only accept IP packets of the configured type and ARP packets */
|
||||
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
@@ -1397,7 +1407,7 @@ static void enc_rxdispatch(FAR struct enc_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);
|
||||
@@ -1428,7 +1438,7 @@ static void enc_rxdispatch(FAR struct enc_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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user