diff --git a/src/core/pbuf.c b/src/core/pbuf.c index e6027261..bee6080f 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -250,7 +250,7 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type) /* bail out unsuccessfully */ return NULL; } - qlen = LWIP_MIN(rem_len, (u16_t)(PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset))); + qlen = LWIP_MIN(rem_len, (u16_t)(PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF + offset))); pbuf_init_alloced_pbuf(q, LWIP_MEM_ALIGN((void *)((u8_t *)q + SIZEOF_STRUCT_PBUF + offset)), rem_len, qlen, type, 0); LWIP_ASSERT("pbuf_alloc: pbuf q->payload properly aligned",