mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
Work on bug #48824: ethernet.c extensions: Implement hook for unknown ethernet protocols
This commit is contained in:
parent
bae4d6398c
commit
f170dde1c6
@ -2529,6 +2529,15 @@
|
||||
#ifdef __DOXYGEN__
|
||||
#define LWIP_HOOK_MEMP_AVAILABLE(memp_t_type)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif):
|
||||
* Called from ethernet_input() when an unknown eth type is encountered.
|
||||
* Return ERR_OK if packet is accepted, any error code otherwise.
|
||||
*/
|
||||
#ifdef __DOXYGEN__
|
||||
#define LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif)
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
@ -208,10 +208,17 @@ ethernet_input(struct pbuf *p, struct netif *netif)
|
||||
#endif /* LWIP_IPV6 */
|
||||
|
||||
default:
|
||||
ETHARP_STATS_INC(etharp.proterr);
|
||||
ETHARP_STATS_INC(etharp.drop);
|
||||
MIB2_STATS_NETIF_INC(netif, ifinunknownprotos);
|
||||
goto free_and_return;
|
||||
#ifdef LWIP_HOOK_UNKNOWN_ETH_PROTOCOL
|
||||
if(LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(p, netif) != ERR_OK) {
|
||||
#endif
|
||||
ETHARP_STATS_INC(etharp.proterr);
|
||||
ETHARP_STATS_INC(etharp.drop);
|
||||
MIB2_STATS_NETIF_INC(netif, ifinunknownprotos);
|
||||
goto free_and_return;
|
||||
#ifdef LWIP_HOOK_UNKNOWN_ETH_PROTOCOL
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* This means the pbuf is freed or consumed,
|
||||
|
Loading…
Reference in New Issue
Block a user