Produce an error if the UIP_TCP_MSS is too large for UIP_BUFSIZE

This commit is contained in:
Adam Dunkels 2013-11-22 15:46:48 +01:00
parent 61a8fa9977
commit ea4bc3816f

View file

@ -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