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 <ravikumar.veeramally@linux.intel.com>
This commit is contained in:
parent
b458ebf755
commit
5012223b31
1 changed files with 4 additions and 0 deletions
|
@ -521,6 +521,9 @@ static int ethernet_send(struct net_if *iface, struct net_pkt *pkt)
|
|||
} else if (IS_ENABLED(CONFIG_NET_IPV6) &&
|
||||
net_pkt_family(pkt) == AF_INET6) {
|
||||
ptype = htons(NET_ETH_PTYPE_IPV6);
|
||||
} else if (IS_ENABLED(CONFIG_NET_SOCKETS_PACKET) &&
|
||||
net_pkt_family(pkt) == AF_PACKET) {
|
||||
goto send;
|
||||
} else if (IS_ENABLED(CONFIG_NET_GPTP) && net_pkt_is_gptp(pkt)) {
|
||||
ptype = htons(NET_ETH_PTYPE_PTP);
|
||||
} 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)
|
|||
|
||||
net_pkt_cursor_init(pkt);
|
||||
|
||||
send:
|
||||
ret = api->send(net_if_get_device(iface), pkt);
|
||||
if (ret != 0) {
|
||||
eth_stats_update_errors_tx(iface);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue