Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Support caching more than 1 IP address per DNS cache entry #1981

Merged
merged 47 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e9f59e6
Support multiple IP addresses per DNS cache entry.
gkwicker May 4, 2020
bdc8a7e
Add test for multiple IP address DNS cache
gkwicker May 4, 2020
1c5c5e0
Run DNS multiple IP address test on all systems
gkwicker May 4, 2020
efefc8f
Fix build failures
gkwicker May 4, 2020
3333db7
Enable debug printing
gkwicker May 4, 2020
c00c26d
DNS test just retrieving addresses
gkwicker May 5, 2020
8a6af51
Add delay between gethostbyname() calls
gkwicker May 5, 2020
75d55fe
increase number of loops in test to determine pattern
gkwicker May 5, 2020
aff590a
Allow 60 seconds to collect all DNS answers
gkwicker May 5, 2020
a08fe63
fix build error
gkwicker May 5, 2020
fb54b45
Do not update duplicate IP addresses in DNS cache
gkwicker May 5, 2020
1a5025c
Eliminate duplicate scan in DNS multiple address cache
gkwicker May 5, 2020
78f4ead
Change debug print in DNS test
gkwicker May 5, 2020
ef30a6c
Fix test bug, increase debug logging on nuvoton.
gkwicker May 6, 2020
8f298fd
Increase DNS response collection time to 60s
gkwicker May 6, 2020
770ad8a
Merge branch 'master' of https://github.com/aws/amazon-freertos
gkwicker May 6, 2020
73abe57
Correct type promotion error uncovered by CBMC.
gkwicker May 6, 2020
6ed9398
Convert IP address index struct members to uint32_t
gkwicker May 6, 2020
8876e93
Harden the code to handle uninitialized/corrupted DNS cache fields.
gkwicker May 7, 2020
39028b5
Support multiple IP addresses per DNS cache entry.
gkwicker May 4, 2020
10e168b
Add test for multiple IP address DNS cache
gkwicker May 4, 2020
d9cd0ef
Run DNS multiple IP address test on all systems
gkwicker May 4, 2020
3faa9ee
Fix build failures
gkwicker May 4, 2020
1d56c77
Enable debug printing
gkwicker May 4, 2020
14d0cbb
DNS test just retrieving addresses
gkwicker May 5, 2020
0fea8a9
Add delay between gethostbyname() calls
gkwicker May 5, 2020
ac6172e
increase number of loops in test to determine pattern
gkwicker May 5, 2020
196f145
Allow 60 seconds to collect all DNS answers
gkwicker May 5, 2020
f43e68b
fix build error
gkwicker May 5, 2020
b407fa4
Do not update duplicate IP addresses in DNS cache
gkwicker May 5, 2020
46c1993
Eliminate duplicate scan in DNS multiple address cache
gkwicker May 5, 2020
91ce414
Change debug print in DNS test
gkwicker May 5, 2020
34ff898
Fix test bug, increase debug logging on nuvoton.
gkwicker May 6, 2020
fd22213
Increase DNS response collection time to 60s
gkwicker May 6, 2020
327f188
Correct type promotion error uncovered by CBMC.
gkwicker May 6, 2020
b794e20
Convert IP address index struct members to uint32_t
gkwicker May 6, 2020
5f2ba3a
Harden the code to handle uninitialized/corrupted DNS cache fields.
gkwicker May 7, 2020
d2a4bb0
Merge branch 'master' of https://github.com/gkwicker/amazon-freertos
gkwicker May 7, 2020
1597707
Test change
gkwicker May 7, 2020
c636a40
Merge branch 'master' of https://github.com/aws/amazon-freertos
gkwicker May 7, 2020
8c612a6
Address PR comments.
gkwicker May 8, 2020
f41125c
Merge branch 'master' of https://github.com/aws/amazon-freertos
gkwicker May 8, 2020
48ebb12
Merge branch 'master' of https://github.com/aws/amazon-freertos
gkwicker May 12, 2020
5414fbd
Address PR comments
gkwicker May 12, 2020
5ff6831
Fix spelling error
gkwicker May 12, 2020
23a4ca2
Address code review comments.
gkwicker May 13, 2020
5f4b529
Fix build error.
gkwicker May 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions libraries/abstractions/secure_sockets/test/iot_test_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ typedef struct
#define tcptestNUM_ECHO_CLIENTS ( 2 )
#define tcptestMAX_LOOPS_ECHO_CLIENTS_LOOP ( 10 )

#define dnstestNUM_UNIQUE_IP_ADDRESSES ( 4 )

static void prvThreadSafeDifferentSocketsDifferentTasks( void * pvParameters );
/****************** Unity Test Code *********************************/
size_t xHeapB;
Expand Down Expand Up @@ -805,6 +807,7 @@ TEST_GROUP_RUNNER( Full_TCP )
RUN_TEST_CASE( Full_TCP, AFQP_SOCKETS_Recv_Invalid );
RUN_TEST_CASE( Full_TCP, AFQP_SOCKETS_htons_HappyCase );
RUN_TEST_CASE( Full_TCP, AFQP_SOCKETS_inet_addr_quick_HappyCase );
RUN_TEST_CASE( Full_TCP, test_dns_multiple_addresses );

#if ( tcptestSECURE_SERVER == 1 )
RUN_TEST_CASE( Full_TCP, AFQP_SECURE_SOCKETS_CloseInvalidParams );
Expand Down Expand Up @@ -2961,6 +2964,60 @@ TEST( Full_TCP, AFQP_SOCKETS_htons_HappyCase )
}
/*-----------------------------------------------------------*/

TEST( Full_TCP, test_dns_multiple_addresses )
{
BaseType_t xResult = pdFAIL;
uint32_t i;
uint32_t j;
uint32_t ulIPAddress;
uint32_t ulUnique;
uint32_t ulNumUniqueIPAddresses = 0;

/* Resolve the AWS IoT Core endpoint, which will have multiple IP addresses */

uint32_t ulIPAddresses[ dnstestNUM_UNIQUE_IP_ADDRESSES ] = { 0UL };

tcptestPRINTF( ( "Starting %s.\r\n", __FUNCTION__ ) );
/*
* Resolve the endpoint to an array of IP addresses. Each subsequent
* call will return one of the addresses which the name resolves to.
*
* NOTE: Resolving addresses can take some time, so allow up to
* 60 seconds to collect all of them.
*/
for( i = 0 ; ( i < 60 ) && ( ulNumUniqueIPAddresses < dnstestNUM_UNIQUE_IP_ADDRESSES ) ; i ++ )
{
ulIPAddress = SOCKETS_GetHostByName( clientcredentialMQTT_BROKER_ENDPOINT );

for( j = 0, ulUnique = 1 ; j < ulNumUniqueIPAddresses ; j++ )
{
if( ulIPAddresses[ j ] == ulIPAddress )
{
ulUnique = 0;
}
}
if( ( ulUnique == 1 ) && ( ulNumUniqueIPAddresses < dnstestNUM_UNIQUE_IP_ADDRESSES ) )
{
ulIPAddresses[ ulNumUniqueIPAddresses++ ] = ulIPAddress;
}
vTaskDelay( 1000 / portTICK_PERIOD_MS );
}
configPRINTF( ( "%s: identified %d different IP addresses for %s.\r\n",
__FUNCTION__,
ulNumUniqueIPAddresses,
clientcredentialMQTT_BROKER_ENDPOINT ) );

/* Require a minimum number of IP addresses for AWS IoT Core endpoints */
if( ulNumUniqueIPAddresses >= dnstestNUM_UNIQUE_IP_ADDRESSES )
{
xResult = pdPASS;
}
TEST_ASSERT_EQUAL_UINT32_MESSAGE( pdPASS, xResult, "Incorrect number of IP addresses per entry" );
tcptestPRINTF( ( "%s complete.\r\n", __FUNCTION__ ) );
}

/*-----------------------------------------------------------*/

TEST( Full_TCP, AFQP_SOCKETS_inet_addr_quick_HappyCase )
{
uint32_t ulPackedIpAddress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,13 @@ from the FreeRTOSIPConfig.h configuration header file. */
#ifndef ipconfigDNS_CACHE_ENTRIES
#define ipconfigDNS_CACHE_ENTRIES 1
#endif

/* When accessing services which have multiple IP addresses, setting this
greater than 1 can improve reliability by returning different IP address
answers on successive calls to FreeRTOS_gethostbyname(). */
#ifndef ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY
#define ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY 1
#endif
#endif /* ipconfigUSE_DNS_CACHE != 0 */

#ifndef ipconfigCHECK_IP_QUEUE_SPACE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,14 @@ static uint32_t prvGetHostByName( const char *pcHostName,

typedef struct xDNS_CACHE_TABLE_ROW
{
uint32_t ulIPAddress; /* The IP address of an ARP cache entry. */
uint32_t ulIPAddress[ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY]; /* The IP address(es) of an ARP cache entry. */
char pcName[ ipconfigDNS_CACHE_NAME_LENGTH ]; /* The name of the host */
uint32_t ulTTL; /* Time-to-Live (in seconds) from the DNS server. */
uint32_t ulTimeWhenAddedInSeconds;
#if( ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY > 1 )
uint8_t ucNumIPAddresses;
uint8_t ucCurrentIPAddress;
#endif
} DNSCacheRow_t;

static DNSCacheRow_t xDNSCache[ ipconfigDNS_CACHE_ENTRIES ];
Expand Down Expand Up @@ -1075,7 +1079,7 @@ uint16_t x, usDataLength, usQuestions;

if( ( pxDNSMessageHeader->usFlags & dnsRX_FLAGS_MASK ) == dnsEXPECTED_RX_FLAGS )
{
for( x = 0; x < pxDNSMessageHeader->usAnswers; x++ )
for( x = 0; ( x < pxDNSMessageHeader->usAnswers ) && ( x < ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY ); x++ )
{
pucByte = prvSkipNameField( pucByte,
uxSourceBytesRemaining );
Expand Down Expand Up @@ -1137,7 +1141,11 @@ uint16_t x, usDataLength, usQuestions;

pucByte += sizeof( DNSAnswerRecord_t ) + sizeof( uint32_t );
uxSourceBytesRemaining -= ( sizeof( DNSAnswerRecord_t ) + sizeof( uint32_t ) );
break;

#if( ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY <= 1 )
/* One response was received, which is enough for this configuration. */
break;
#endif
}
else if( uxSourceBytesRemaining >= sizeof( DNSAnswerRecord_t ) )
{
Expand Down Expand Up @@ -1471,6 +1479,7 @@ BaseType_t xReturn;
BaseType_t x;
BaseType_t xFound = pdFALSE;
uint32_t ulCurrentTimeSeconds = ( xTaskGetTickCount() / portTICK_PERIOD_MS ) / 1000;
uint32_t ulIPAddressIndex = 0;
static BaseType_t xFreeEntry = 0;
configASSERT(pcName);

Expand All @@ -1490,7 +1499,18 @@ BaseType_t xReturn;
/* Confirm that the record is still fresh. */
if( ulCurrentTimeSeconds < ( xDNSCache[ x ].ulTimeWhenAddedInSeconds + FreeRTOS_ntohl( xDNSCache[ x ].ulTTL ) ) )
{
*pulIP = xDNSCache[ x ].ulIPAddress;
#if( ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY > 1 )
/* The ucCurrentIPAddress value increments without bound and will rollover, */
/* modulo it by the number of IP addresses to keep it in range. */
/* Also perform a final modulo by the max number of IP addresses */
/* per DNS cache entry to prevent out-of-bounds access in the event */
/* that ucNumIPAddresses has been corrupted. */
ulIPAddressIndex = ( xDNSCache[ x ].ucCurrentIPAddress %
xDNSCache[ x ].ucNumIPAddresses ) % ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY;

xDNSCache[ x ].ucCurrentIPAddress++;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suppose that 10 addresses were found. When calling this function repeatedly, I would see the addresses 0..9, 0..9, and when ucCurrentIPAddress becomes 255, I would see 0..5, followed by 0..9 again?

Why not:

if( ++xDNSCache[ x ].ucCurrentIPAddress == xDNSCache[ x ].ucNumIPAddresses )
{
	xDNSCache[ x ].ucCurrentIPAddress = 0;
}

Making ucCurrentIPAddress a uint8_t is no problem, DNS can not return more than +/- 27 answers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more general question about the change:
Suppose I'm looking up the addresses of some host and it receives 5 IP-addresses.
I will call FreeRTOS_gethostbyname() repeatedly to see all addresses.
How do I know when I've seen all IP-addresses? Should I remember the first IP-address received?
Why not return 0 after the last IP-address was returned? And then the first IP-address again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applications using FreeRTOS_gethostbyname() should interpret the result as an independent scalar value rather than a member of a list, and they should not prefer any value over any other. When we have an implementation of FreeRTOS_getaddrinfo(), applications will have the option of choosing a particular address, which could be useful in some circumstances.

The reasoning behind this change is to give app developers an easy way to increase reliability of their app when connecting to a load-balanced service, without requiring them to change any application logic. As just one example, the amazon-freertos repo has dozens of tests and demos which can benefit immediately without any modification.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suppose that 10 addresses were found. When calling this function repeatedly, I would see the addresses 0..9, 0..9, and when ucCurrentIPAddress becomes 255, I would see 0..5, followed by 0..9 again?

Why not:

if( ++xDNSCache[ x ].ucCurrentIPAddress == xDNSCache[ x ].ucNumIPAddresses )
{
	xDNSCache[ x ].ucCurrentIPAddress = 0;
}

Making ucCurrentIPAddress a uint8_t is no problem, DNS can not return more than +/- 27 answers.

I didn't choose this option because I didn't want to have to do anything for thread safety for cases where two tasks both call FreeRTOS_gethostbyname(). In the event that there was a context switch after the if but before the statement in {...}, we could have a TOCTOU error resulting in an out-of-bound array access.

The side effect of doing the modulo approach as you have pointed out is that you the order that addresses appear may not reflect how they are stored internally, but this isn't important since the caller should make no assumption about these values. The only thing that is promised is that FreeRTOS_gethostbyname() will return an answer if one is available.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't choose this option because I didn't want to have to do anything for thread safety for cases where two tasks both call FreeRTOS_gethostbyname(). In the event that there was a context switch after the if but before the statement in {...}, we could have a TOCTOU error resulting in an out-of-bound array access.

What if we do

if( ++xDNSCache[ x ].ucCurrentIPAddress >= xDNSCache[ x ].ucNumIPAddresses )
{   /* Use >=  instead of == */
     .... 
}

Would it remove TOCTOU error? I could not think of a case where it fails. Do correct me if I am wrong.
I am just trying to reduce computation as much as we can. Modulo operation is quite expensive than a comparison statement in a lot of architectures.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember that if interrupts aren't masked, a context switch can happen at any time. And since this code is not protected by any mutual-exclusion mechanism such as a mutex or semaphore (and we don't want to add those if we don't have to), you can still have the error.

In any case, the code as written is simpler and avoids any possibility of this occurring.

#endif
*pulIP = xDNSCache[ x ].ulIPAddress[ulIPAddressIndex];
}
else
{
Expand All @@ -1500,7 +1520,16 @@ BaseType_t xReturn;
}
else
{
xDNSCache[ x ].ulIPAddress = *pulIP;
#if( ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY > 1 )
if ( xDNSCache[ x ].ucNumIPAddresses < ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY )
{
/* If more answers exist than there are IP address storage slots */
/* they will overwrite entry 0 */

ulIPAddressIndex = xDNSCache[ x ].ucNumIPAddresses++;
}
#endif
xDNSCache[ x ].ulIPAddress[ulIPAddressIndex] = *pulIP;
xDNSCache[ x ].ulTTL = ulTTL;
xDNSCache[ x ].ulTimeWhenAddedInSeconds = ulCurrentTimeSeconds;
}
Expand All @@ -1523,10 +1552,19 @@ BaseType_t xReturn;
{
strcpy( xDNSCache[ xFreeEntry ].pcName, pcName );

xDNSCache[ xFreeEntry ].ulIPAddress = *pulIP;
xDNSCache[ xFreeEntry ].ulIPAddress[0] = *pulIP;
xDNSCache[ xFreeEntry ].ulTTL = ulTTL;
xDNSCache[ xFreeEntry ].ulTimeWhenAddedInSeconds = ulCurrentTimeSeconds;

#if( ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY > 1 )
xDNSCache[ xFreeEntry ].ucNumIPAddresses = 1;
xDNSCache[ xFreeEntry ].ucCurrentIPAddress = 0;

/* Initialize all remaining IP addresses in this entry to 0 */
memset( &xDNSCache[ xFreeEntry ].ulIPAddress[ 1 ],
0,
sizeof( xDNSCache[ xFreeEntry ].ulIPAddress[ 1 ] ) *
( ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY - 1 ) );
#endif
xFreeEntry++;

if( xFreeEntry == ipconfigDNS_CACHE_ENTRIES )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,9 @@
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket.
*
* NOTE: Use caution when enabling the DNS cache and connecting to services which
* use a load balancer. Since the cache only holds a single IP address, if that
* address is out of date, no connections to the host will succeed until the TTL
* expires. See this GitHub issue for more details.
*
* https://github.com/FreeRTOS/FreeRTOS/issues/58
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to have a similar note to this for a scenario where ipconfigUSE_DNS_CACHE == 1 and ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY == 1? This seems like it would have the same issue that this note addresses.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would, that's a good point. I'll add a note in the example FreeRTOSIPConfig.h about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a clarifying comment in FreeRTOSIPConfigDefaults.h

#define ipconfigUSE_DNS_CACHE ( 0 )
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY ( 6 )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this 6U? MISRA tends to dislike operations between signed and unsigned values. (Such as modulo operation in FreeRTOS_DNS.c)

Copy link
Contributor Author

@gkwicker gkwicker May 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is vendor code and it likely has the same issues throughout (see line 77). If Coverity raises a warning, we'll address that in a separate PR.

#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )

/* The IP stack executes it its own task (although any application task can make
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,9 @@
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket.
*
* NOTE: Use caution when enabling the DNS cache and connecting to services which
* use a load balancer. Since the cache only holds a single IP address, if that
* address is out of date, no connections to the host will succeed until the TTL
* expires. See this GitHub issue for more details.
*
* https://github.com/FreeRTOS/FreeRTOS/issues/58
*/
#define ipconfigUSE_DNS_CACHE ( 0 )
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY ( 6 )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this 6U? MISRA tends to dislike arithmetic operations between signed and unsigned variables,.

Copy link
Contributor Author

@gkwicker gkwicker May 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment, that will be addressed in a PR if Coverity raises a warning.

#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )

/* The IP stack executes it its own task (although any application task can make
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,9 @@
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket.
*
* NOTE: Use caution when enabling the DNS cache and connecting to services which
* use a load balancer. Since the cache only holds a single IP address, if that
* address is out of date, no connections to the host will succeed until the TTL
* expires. See this GitHub issue for more details.
*
* https://github.com/FreeRTOS/FreeRTOS/issues/58
*/
#define ipconfigUSE_DNS_CACHE ( 0 )
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY ( 6 )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this 6U? MISRA tends to dislike arithmetic operations between signed and unsigned variables.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction in other ports as well if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment.

#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )

/* The IP stack executes it its own task (although any application task can make
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,9 @@
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket.
*
* NOTE: Use caution when enabling the DNS cache and connecting to services which
* use a load balancer. Since the cache only holds a single IP address, if that
* address is out of date, no connections to the host will succeed until the TTL
* expires. See this GitHub issue for more details.
*
* https://github.com/FreeRTOS/FreeRTOS/issues/58
*/
#define ipconfigUSE_DNS_CACHE ( 0 )
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY ( 6 )
#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )

/* The IP stack executes it its own task (although any application task can make
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,9 @@ extern void vLoggingPrintf( const char * pcFormatString,
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket.
*
* NOTE: Use caution when enabling the DNS cache and connecting to services which
* use a load balancer. Since the cache only holds a single IP address, if that
* address is out of date, no connections to the host will succeed until the TTL
* expires. See this GitHub issue for more details.
*
* https://github.com/FreeRTOS/FreeRTOS/issues/58
*/
#define ipconfigUSE_DNS_CACHE ( 0 )
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY ( 6 )
#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )

/* The IP stack executes it its own task (although any application task can make
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,9 @@ extern void vLoggingPrintf( const char * pcFormatString,
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket.
*
* NOTE: Use caution when enabling the DNS cache and connecting to services which
* use a load balancer. Since the cache only holds a single IP address, if that
* address is out of date, no connections to the host will succeed until the TTL
* expires. See this GitHub issue for more details.
*
* https://github.com/FreeRTOS/FreeRTOS/issues/58
*/
#define ipconfigUSE_DNS_CACHE ( 0 )
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY ( 6 )
#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )

/* The IP stack executes it its own task (although any application task can make
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,9 @@ extern void vLoggingPrintf( const char * pcFormatString,
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket.
*
* NOTE: Use caution when enabling the DNS cache and connecting to services which
* use a load balancer. Since the cache only holds a single IP address, if that
* address is out of date, no connections to the host will succeed until the TTL
* expires. See this GitHub issue for more details.
*
* https://github.com/FreeRTOS/FreeRTOS/issues/58
*/
#define ipconfigUSE_DNS_CACHE ( 0 )
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY ( 6 )
#define ipconfigDNS_CACHE_NAME_LENGTH ( 16 )
#define ipconfigDNS_CACHE_ENTRIES ( 4 )
#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,9 @@
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket.
*
* NOTE: Use caution when enabling the DNS cache and connecting to services which
* use a load balancer. Since the cache only holds a single IP address, if that
* address is out of date, no connections to the host will succeed until the TTL
* expires. See this GitHub issue for more details.
*
* https://github.com/FreeRTOS/FreeRTOS/issues/58
*/
#define ipconfigUSE_DNS_CACHE ( 0 )
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY ( 6 )
#define ipconfigDNS_CACHE_NAME_LENGTH ( 16 )
#define ipconfigDNS_CACHE_ENTRIES ( 4 )
#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,9 @@ extern void vLoggingPrintf( const char * pcFormatString,
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket.
*
* NOTE: Use caution when enabling the DNS cache and connecting to services which
* use a load balancer. Since the cache only holds a single IP address, if that
* address is out of date, no connections to the host will succeed until the TTL
* expires. See this GitHub issue for more details.
*
* https://github.com/FreeRTOS/FreeRTOS/issues/58
*/
#define ipconfigUSE_DNS_CACHE ( 0 )
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY ( 6 )
#define ipconfigDNS_CACHE_NAME_LENGTH ( 16 )
#define ipconfigDNS_CACHE_ENTRIES ( 4 )
#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,9 @@
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket.
*
* NOTE: Use caution when enabling the DNS cache and connecting to services which
* use a load balancer. Since the cache only holds a single IP address, if that
* address is out of date, no connections to the host will succeed until the TTL
* expires. See this GitHub issue for more details.
*
* https://github.com/FreeRTOS/FreeRTOS/issues/58
*/
#define ipconfigUSE_DNS_CACHE ( 0 )
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY ( 6 )
#define ipconfigDNS_CACHE_NAME_LENGTH ( 16 )
#define ipconfigDNS_CACHE_ENTRIES ( 4 )
#define ipconfigDNS_REQUEST_ATTEMPTS ( 2 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,9 @@ extern void vLoggingPrintf( const char * pcFormatString,
* socket has been destroyed, the result will be stored into the cache. The next
* call to FreeRTOS_gethostbyname() will return immediately, without even creating
* a socket.
*
* NOTE: Use caution when enabling the DNS cache and connecting to services which
* use a load balancer. Since the cache only holds a single IP address, if that
* address is out of date, no connections to the host will succeed until the TTL
* expires. See this GitHub issue for more details.
*
* https://github.com/FreeRTOS/FreeRTOS/issues/58
*/
#define ipconfigUSE_DNS_CACHE ( 0 )
#define ipconfigUSE_DNS_CACHE ( 1 )
#define ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY ( 6 )
#define ipconfigDNS_REQUEST_ATTEMPTS ( 10 )

/* The IP stack executes it its own task (although any application task can make
Expand Down
Loading