From dc41eabf5f2c6c3dbd02a0ad0dcd6dcb2def2b19 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Mon, 3 Feb 2020 21:49:57 +0100 Subject: [PATCH] nd6: check defines for global tables for validity Signed-off-by: Simon Goldschmidt --- src/core/ipv6/nd6.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/ipv6/nd6.c b/src/core/ipv6/nd6.c index 5f527327..d156d296 100644 --- a/src/core/ipv6/nd6.c +++ b/src/core/ipv6/nd6.c @@ -72,6 +72,18 @@ #if LWIP_IPV6_DUP_DETECT_ATTEMPTS > IP6_ADDR_TENTATIVE_COUNT_MASK #error LWIP_IPV6_DUP_DETECT_ATTEMPTS > IP6_ADDR_TENTATIVE_COUNT_MASK #endif +#if LWIP_ND6_NUM_NEIGHBORS > 127 +#error LWIP_ND6_NUM_NEIGHBORS must fit into an s8_t (max value: 127) +#endif +#if LWIP_ND6_NUM_DESTINATIONS > 32767 +#error LWIP_ND6_NUM_DESTINATIONS must fit into an s16_t (max value: 32767) +#endif +#if LWIP_ND6_NUM_PREFIXES > 127 +#error LWIP_ND6_NUM_PREFIXES must fit into an s8_t (max value: 127) +#endif +#if LWIP_ND6_NUM_ROUTERS > 127 +#error LWIP_ND6_NUM_ROUTERS must fit into an s8_t (max value: 127) +#endif /* Router tables. */ struct nd6_neighbor_cache_entry neighbor_cache[LWIP_ND6_NUM_NEIGHBORS];