mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-10 01:23:48 +08:00
Added input & route hooks for IPv6 to stay in line with IPv4
This commit is contained in:
@@ -83,6 +83,13 @@ ip6_route(const struct ip6_addr *src, const struct ip6_addr *dest)
|
||||
struct netif *netif;
|
||||
s8_t i;
|
||||
|
||||
#ifdef LWIP_HOOK_IP6_ROUTE
|
||||
netif = LWIP_HOOK_IP6_ROUTE(src, dest);
|
||||
if (netif != NULL) {
|
||||
return netif;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If single netif configuration, fast return. */
|
||||
if ((netif_list != NULL) && (netif_list->next == NULL)) {
|
||||
if (!netif_is_up(netif_list) || !netif_is_link_up(netif_list)) {
|
||||
@@ -388,6 +395,13 @@ ip6_input(struct pbuf *p, struct netif *inp)
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
#ifdef LWIP_HOOK_IP6_INPUT
|
||||
if (LWIP_HOOK_IP6_INPUT(p, inp)) {
|
||||
/* the packet has been eaten */
|
||||
return ERR_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* header length exceeds first pbuf length, or ip length exceeds total pbuf length? */
|
||||
if ((IP6_HLEN > p->len) || ((IP6H_PLEN(ip6hdr) + IP6_HLEN) > p->tot_len)) {
|
||||
if (IP6_HLEN > p->len) {
|
||||
|
||||
Reference in New Issue
Block a user