mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08: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__
|
#ifdef __DOXYGEN__
|
||||||
#define LWIP_HOOK_MEMP_AVAILABLE(memp_t_type)
|
#define LWIP_HOOK_MEMP_AVAILABLE(memp_t_type)
|
||||||
#endif
|
#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 */
|
#endif /* LWIP_IPV6 */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ETHARP_STATS_INC(etharp.proterr);
|
#ifdef LWIP_HOOK_UNKNOWN_ETH_PROTOCOL
|
||||||
ETHARP_STATS_INC(etharp.drop);
|
if(LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(p, netif) != ERR_OK) {
|
||||||
MIB2_STATS_NETIF_INC(netif, ifinunknownprotos);
|
#endif
|
||||||
goto free_and_return;
|
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,
|
/* This means the pbuf is freed or consumed,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user