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:
parent
eddb6c8111
commit
0516d75d84
2 changed files with 13 additions and 0 deletions
|
@ -108,4 +108,12 @@ config NET_ETHERNET_BRIDGE_DEFAULT
|
|||
Say y if this is the case. If you only want to inspect
|
||||
existing bridge instances then say n.
|
||||
|
||||
config NET_ETHERNET_FORWARD_UNRECOGNISED_ETHERTYPE
|
||||
bool "Forward unrecognized EtherType frames further into net stack"
|
||||
default y if NET_SOCKETS_PACKET
|
||||
help
|
||||
When enabled, the Ethernet L2 will forward even those frames for which
|
||||
it does not recognize the EtherType in the header. By default, such
|
||||
frames are dropped at the L2 processing.
|
||||
|
||||
endif # NET_L2_ETHERNET
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue