net: ethernet: Add Kconfig option to forward unrecognized EtherType frames

Add Kconfig option to the Ethernet L2 which allows to forward frames
with unknown EtherType further into the stack. This can be useful for
packet sockets, where further frame processing is application dependent.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2022-05-17 09:33:17 +02:00 committed by Marti Bolivar
commit 0516d75d84
2 changed files with 13 additions and 0 deletions

View file

@ -254,6 +254,11 @@ static enum net_verdict ethernet_recv(struct net_if *iface,
goto drop;
#endif
default:
if (IS_ENABLED(CONFIG_NET_ETHERNET_FORWARD_UNRECOGNISED_ETHERTYPE)) {
family = AF_UNSPEC;
break;
}
NET_DBG("Unknown hdr type 0x%04x iface %p", type, iface);
goto drop;
}