BugID:23251508: DNS: added compile-time check for some defines to fit into an u8_t (bug
commit
Author: goldsimon
Date:   Wed Dec 7 09:09:45 2016 +0100
@@ -132,6 +132,13 @@ static u16_t dns_txid;
#error DNS_MAX_TTL must be a positive 32-bit value
#endif
+#if DNS_TABLE_SIZE > 255
+#error DNS_TABLE_SIZE must fit into an u8_t
+#endif
+#if DNS_MAX_SERVERS > 255
+#error DNS_MAX_SERVERS must fit into an u8_t
+#endif
+
/* The number of parallel requests (i.e. calls to dns_gethostbyname
* that cannot be answered from the DNS table.
* This is set to the table size by default.
@@ -139,6 +146,10 @@ static u16_t dns_txid;
#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING) != 0)
#ifndef DNS_MAX_REQUESTS
#define DNS_MAX_REQUESTS DNS_TABLE_SIZE
+#else
+#if DNS_MAX_REQUESTS > 255
+#error DNS_MAX_REQUESTS must fit into an u8_t
+#endif
#endif
#else
/* In this configuration, both arrays have to have the same size and are used
@@ -150,6 +161,10 @@ static u16_t dns_txid;
#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) != 0)
#ifndef DNS_MAX_SOURCE_PORTS
#define DNS_MAX_SOURCE_PORTS DNS_MAX_REQUESTS
+#else
+#if DNS_MAX_SOURCE_PORTS > 255
+#error DNS_MAX_SOURCE_PORTS must fit into an u8_t
+#endif
#endif
#else
#ifdef DNS_MAX_SOURCE_PORTS
