mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 13:34:38 +08:00
DNS: added compile-time check for some defines to fit into an u8_t (bug #49658)
This commit is contained in:
parent
e00a131160
commit
c87855423c
@ -116,6 +116,13 @@ static u16_t dns_txid;
|
|||||||
#error DNS_MAX_TTL must be a positive 32-bit value
|
#error DNS_MAX_TTL must be a positive 32-bit value
|
||||||
#endif
|
#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
|
/* The number of parallel requests (i.e. calls to dns_gethostbyname
|
||||||
* that cannot be answered from the DNS table.
|
* that cannot be answered from the DNS table.
|
||||||
* This is set to the table size by default.
|
* This is set to the table size by default.
|
||||||
@ -123,6 +130,10 @@ static u16_t dns_txid;
|
|||||||
#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING) != 0)
|
#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING) != 0)
|
||||||
#ifndef DNS_MAX_REQUESTS
|
#ifndef DNS_MAX_REQUESTS
|
||||||
#define DNS_MAX_REQUESTS DNS_TABLE_SIZE
|
#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
|
#endif
|
||||||
#else
|
#else
|
||||||
/* In this configuration, both arrays have to have the same size and are used
|
/* In this configuration, both arrays have to have the same size and are used
|
||||||
@ -134,6 +145,10 @@ static u16_t dns_txid;
|
|||||||
#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) != 0)
|
#if ((LWIP_DNS_SECURE & LWIP_DNS_SECURE_RAND_SRC_PORT) != 0)
|
||||||
#ifndef DNS_MAX_SOURCE_PORTS
|
#ifndef DNS_MAX_SOURCE_PORTS
|
||||||
#define DNS_MAX_SOURCE_PORTS DNS_MAX_REQUESTS
|
#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
|
#endif
|
||||||
#else
|
#else
|
||||||
#ifdef DNS_MAX_SOURCE_PORTS
|
#ifdef DNS_MAX_SOURCE_PORTS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user