Skip to content

Commit 673c9f1

Browse files
committed
net: l2: ethernet: Handover net packets to driver
If packet family is AF_PACKET and CONFIG_NET_SOCKETS_PACKET is enabled, just handover the packet to driver for sending. L2 layer will not touch AF_PACKETs at the moment. Signed-off-by: Ravi kumar Veeramally <[email protected]>
1 parent 2d9c53d commit 673c9f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subsys/net/l2/ethernet/ethernet.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,9 @@ static int ethernet_send(struct net_if *iface, struct net_pkt *pkt)
521521
} else if (IS_ENABLED(CONFIG_NET_IPV6) &&
522522
net_pkt_family(pkt) == AF_INET6) {
523523
ptype = htons(NET_ETH_PTYPE_IPV6);
524+
} else if (IS_ENABLED(CONFIG_NET_SOCKETS_PACKET) &&
525+
net_pkt_family(pkt) == AF_PACKET) {
526+
goto send;
524527
} else if (IS_ENABLED(CONFIG_NET_GPTP) && net_pkt_is_gptp(pkt)) {
525528
ptype = htons(NET_ETH_PTYPE_PTP);
526529
} else if (IS_ENABLED(CONFIG_NET_LLDP) && net_pkt_is_lldp(pkt)) {
@@ -563,6 +566,7 @@ static int ethernet_send(struct net_if *iface, struct net_pkt *pkt)
563566

564567
net_pkt_cursor_init(pkt);
565568

569+
send:
566570
ret = api->send(net_if_get_device(iface), pkt);
567571
if (ret != 0) {
568572
eth_stats_update_errors_tx(iface);

0 commit comments

Comments
 (0)