From fe0b320791184b7f7ed8090cb6706e9586d7b8a7 Mon Sep 17 00:00:00 2001 From: Bill Waters Date: Fri, 1 Oct 2021 13:35:00 -0700 Subject: [PATCH] fix for malformed IPv6 Network Solicitation packet --- third_party/lwip/repo/lwip/src/core/ipv6/nd6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/lwip/repo/lwip/src/core/ipv6/nd6.c b/third_party/lwip/repo/lwip/src/core/ipv6/nd6.c index c085d32d4defd2..4e2718544458fd 100644 --- a/third_party/lwip/repo/lwip/src/core/ipv6/nd6.c +++ b/third_party/lwip/repo/lwip/src/core/ipv6/nd6.c @@ -1111,8 +1111,8 @@ nd6_send_ns(struct netif *netif, const ip6_addr_t *target_addr, u8_t flags) } /* Allocate a packet. */ - p = pbuf_alloc(PBUF_IP, sizeof(struct ns_header) + ND6_LLADDR_OPTION_SIZE(netif->hwaddr_len), PBUF_RAM); - if ((p == NULL) || (p->len < (sizeof(struct ns_header) + ND6_LLADDR_OPTION_SIZE(netif->hwaddr_len)))) { + p = pbuf_alloc(PBUF_IP, sizeof(struct ns_header) + (lladdr_opt_len << 3), PBUF_RAM); + if ((p == NULL) || (p->len < (sizeof(struct ns_header) + (lladdr_opt_len << 3)))) { /* We couldn't allocate a suitable pbuf for the ns. drop it. */ if (p != NULL) { pbuf_free(p);