From ea4bc3816f649175f2d2d3592dd2abd84735ac49 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Fri, 22 Nov 2013 15:46:48 +0100 Subject: [PATCH] Produce an error if the UIP_TCP_MSS is too large for UIP_BUFSIZE --- core/net/uipopt.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/net/uipopt.h b/core/net/uipopt.h index ce871985f..d0d3219ad 100644 --- a/core/net/uipopt.h +++ b/core/net/uipopt.h @@ -382,7 +382,10 @@ * UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN. */ #ifdef UIP_CONF_TCP_MSS -#define UIP_TCP_MSS (UIP_CONF_TCP_MSS) +#if UIP_CONF_TCP_MSS < (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN) +#error UIP_CONF_TCP_MSS is too large for the current UIP_BUFSIZE +#endif /* UIP_CONF_TCP_MSS < (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN) */ +#define UIP_TCP_MSS (UIP_CONF_TCP_MSS) #else #define UIP_TCP_MSS (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN) #endif