Skip to content

Commit

Permalink
fix for malformed IPv6 Network Solicitation packet (#10160)
Browse files Browse the repository at this point in the history
  • Loading branch information
billwatersiii authored Oct 6, 2021
1 parent 9ea2cc4 commit 4a321fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions third_party/lwip/repo/lwip/src/core/ipv6/nd6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4a321fe

Please sign in to comment.