fix bug #44586: nd6_send_rs() pbuf size error

This commit is contained in:
Ivan Delamer 2015-03-20 09:04:22 -06:00
parent c8587e1242
commit a4d14fc987

View File

@ -994,8 +994,8 @@ nd6_send_rs(struct netif * netif)
if (src_addr != IP6_ADDR_ANY) {
lladdr_opt_len = ((netif->hwaddr_len + 2) >> 3) + (((netif->hwaddr_len + 2) & 0x07) ? 1 : 0);
}
p = pbuf_alloc(PBUF_IP, sizeof(struct rs_header) + lladdr_opt_len, PBUF_RAM);
if ((p == NULL) || (p->len < (sizeof(struct rs_header) + lladdr_opt_len))) {
p = pbuf_alloc(PBUF_IP, sizeof(struct rs_header) + lladdr_opt_len << 3, PBUF_RAM);
if ((p == NULL) || (p->len < (sizeof(struct rs_header) + lladdr_opt_len << 3))) {
/* We couldn't allocate a suitable pbuf for the ns. drop it. */
if (p != NULL) {
pbuf_free(p);