fix: parse TCP echo IPv4 address into IPv4 field

Store the parsed IPv4 echo server address in the IPv4 union member instead of writing it into the IPv6 byte array.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
This commit is contained in:
Old-Ding
2026-06-28 02:13:08 +08:00
committed by Felicity Zhao
parent 0e199e6d06
commit 6f81e4ecb1

View File

@@ -273,7 +273,7 @@
}
else
{
rc = FreeRTOS_inet_pton( FREERTOS_AF_INET4, configECHO_SERVER_ADDR_STRING, ( void * ) xEchoServerAddress.sin_address.xIP_IPv6.ucBytes );
rc = FreeRTOS_inet_pton( FREERTOS_AF_INET4, configECHO_SERVER_ADDR_STRING, ( void * ) &( xEchoServerAddress.sin_address.ulIP_IPv4 ) );
configASSERT( rc == pdPASS );
xFamily = FREERTOS_AF_INET4;
}