ip4_canforward(): don't route multicast packets

Added LWIP_HOOK_IP4_CANFORWARD to still implement multicast routing.
See bug #52914

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
Simon Goldschmidt
2018-06-12 06:45:30 +02:00
parent 1fd145fbc9
commit 6ea2483546
2 changed files with 30 additions and 3 deletions

View File

@@ -2886,6 +2886,27 @@
#define LWIP_HOOK_IP4_ROUTE_SRC(src, dest)
#endif
/**
* LWIP_HOOK_IP4_CANFORWARD(src, dest):
* Check if an IPv4 can be forwarded - called from:
* ip4_input() -> ip4_forward() -> ip4_canforward() (IPv4)
* - source address is available via ip4_current_src_addr()
* - calling an output function in this context (e.g. multicast router) is allowed
* Signature:\code{.c}
* int my_hook(struct pbuf *p, u32_t dest_addr_hostorder);
* \endcode
* Arguments:
* - p: packet to forward
* - dest: destination IPv4 address
* Returns values:
* - 1: forward
* - 0: don't forward
* - -1: no decision. In that case, ip4_canforward() continues as normal.
*/
#ifdef __DOXYGEN__
#define LWIP_HOOK_IP4_CANFORWARD(src, dest)
#endif
/**
* LWIP_HOOK_ETHARP_GET_GW(netif, dest):
* Called from etharp_output() (IPv4)