From f4f2bfe3790cf7fe80bc7d2660599c9cb5f70022 Mon Sep 17 00:00:00 2001 From: jifl Date: Tue, 27 Feb 2007 16:50:05 +0000 Subject: [PATCH] Ensure the size of each pbuf in the pool meets alignment constraints --- src/core/pbuf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/pbuf.c b/src/core/pbuf.c index 46deb066..058307ee 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -102,6 +102,9 @@ pbuf_init(void) pbuf_pool = (struct pbuf *)MEM_ALIGN(pbuf_pool_memory); + LWIP_ASSERT("pbuf_init: PBUF_POOL_BUFSIZE not aligned", + (PBUF_POOL_BUFSIZE % MEM_ALIGNMENT) == 0); + #if PBUF_STATS lwip_stats.pbuf.avail = PBUF_POOL_SIZE; #endif /* PBUF_STATS */