diff --git a/source/FreeRTOS_DNS_Parser.c b/source/FreeRTOS_DNS_Parser.c index 9570fac308..bb070c369c 100644 --- a/source/FreeRTOS_DNS_Parser.c +++ b/source/FreeRTOS_DNS_Parser.c @@ -262,7 +262,7 @@ uint16_t x; BaseType_t xReturn = pdTRUE; uint32_t ulIPAddress = 0U; - BaseType_t xDNSHookReturn; + BaseType_t xDNSHookReturn = 0U; ( void ) memset( &( xSet ), 0, sizeof( xSet ) ); xSet.usPortNumber = usPort; diff --git a/source/FreeRTOS_IPv4.c b/source/FreeRTOS_IPv4.c index f2922c1831..32c31d756a 100644 --- a/source/FreeRTOS_IPv4.c +++ b/source/FreeRTOS_IPv4.c @@ -82,7 +82,7 @@ /* Map the buffer onto a IP-Packet struct to easily access the * fields of the IP packet. */ - const IPPacket_t * const pxIPPacket = ( ( const IPPacket_t * const ) pvEthernetBuffer ); + const IPPacket_t * const pxIPPacket = ( ( const IPPacket_t * ) pvEthernetBuffer ); DEBUG_DECLARE_TRACE_VARIABLE( BaseType_t, xLocation, 0 ); diff --git a/source/FreeRTOS_IPv6.c b/source/FreeRTOS_IPv6.c index 0e8f85ea19..2ef65c2550 100644 --- a/source/FreeRTOS_IPv6.c +++ b/source/FreeRTOS_IPv6.c @@ -99,11 +99,11 @@ const struct xIPv6_Address FreeRTOS_in6addr_loopback = { { 0U, 0U, 0U, 0U, 0U, 0 size_t uxMinimumLength; size_t uxExtHeaderLength = 0; const IPExtHeader_IPv6_t * pxExtHeader = NULL; - const uint8_t * const pucEthernetBuffer = ( const uint8_t * const ) pvEthernetBuffer; + const uint8_t * const pucEthernetBuffer = ( const uint8_t * ) pvEthernetBuffer; /* Map the buffer onto a IPv6-Packet struct to easily access the * fields of the IPv6 packet. */ - const IPPacket_IPv6_t * const pxIPv6Packet = ( const IPPacket_IPv6_t * const ) pucEthernetBuffer; + const IPPacket_IPv6_t * const pxIPv6Packet = ( const IPPacket_IPv6_t * ) pucEthernetBuffer; DEBUG_DECLARE_TRACE_VARIABLE( BaseType_t, xLocation, 0 ); diff --git a/source/FreeRTOS_ND.c b/source/FreeRTOS_ND.c index 3dddfc470f..8ed81640dc 100644 --- a/source/FreeRTOS_ND.c +++ b/source/FreeRTOS_ND.c @@ -97,12 +97,6 @@ /** @brief The ND cache. */ static NDCacheRow_t xNDCache[ ipconfigND_CACHE_ENTRIES ]; -/** @brief The time at which the last unsolicited ND was sent. Unsolicited NDs are used - * to ensure ND tables are up to date and to detect IP address conflicts. */ -/* MISRA Ref 8.9.1 [File scoped variables] */ -/* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-89 */ -/* coverity[misra_c_2012_rule_8_9_violation] */ - static TickType_t xLastUnsolicitedNDTime = 0U; /*-----------------------------------------------------------*/ @@ -1405,19 +1399,4 @@ } /*-----------------------------------------------------------*/ - -/** - * @brief Send an unsolicited ND packet to allow this node to announce the IP-MAC - * mapping to the entire network. - */ - void vNDSendUnsolicited( void ) - { - /* Setting xLastUnsolicitedNDTime to 0 will force an unsolicited ND the next - * time vNDAgeCache() is called. */ - xLastUnsolicitedNDTime = ( TickType_t ) 0; - - /* Let the IP-task call vARPAgeCache(). */ - ( void ) xSendEventToIPTask( eNDTimerEvent ); - } -/*-----------------------------------------------------------*/ #endif /* ipconfigUSE_IPv6 */ diff --git a/source/FreeRTOS_RA.c b/source/FreeRTOS_RA.c index 2f6875ff8a..9b0afc73fd 100644 --- a/source/FreeRTOS_RA.c +++ b/source/FreeRTOS_RA.c @@ -329,12 +329,14 @@ case ndICMP_MTU_OPTION: /* 5 */ { - uint32_t ulMTU; - ( void ) ulMTU; - - /* ulChar2u32 returns host-endian numbers. */ - ulMTU = ulChar2u32( &( pucBytes[ uxIndex + 4U ] ) ); - FreeRTOS_printf( ( "RA: MTU = %u\n", ( unsigned int ) ulMTU ) ); + #if ipconfigHAS_PRINTF == 1 + uint32_t ulMTU; + ( void ) ulMTU; + + /* ulChar2u32 returns host-endian numbers. */ + ulMTU = ulChar2u32( &( pucBytes[ uxIndex + 4U ] ) ); + FreeRTOS_printf( ( "RA: MTU = %u\n", ( unsigned int ) ulMTU ) ); + #endif /* ipconfigHAS_PRINTF == 1 */ } break; diff --git a/source/include/FreeRTOS_ND.h b/source/include/FreeRTOS_ND.h index f7c791aceb..3b78461e91 100644 --- a/source/include/FreeRTOS_ND.h +++ b/source/include/FreeRTOS_ND.h @@ -209,8 +209,6 @@ /* Clear all entries in the ND cache. */ void FreeRTOS_ClearND( const struct xNetworkEndPoint * pxEndPoint ); - void vNDSendUnsolicited( void ); - extern const uint8_t pcLOCAL_ALL_NODES_MULTICAST_IP[ ipSIZE_OF_IPv6_ADDRESS ]; extern const uint8_t pcLOCAL_ALL_NODES_MULTICAST_MAC[ ipMAC_ADDRESS_LENGTH_BYTES ]; diff --git a/test/unit-test/FreeRTOS_ND/FreeRTOS_ND_utest.c b/test/unit-test/FreeRTOS_ND/FreeRTOS_ND_utest.c index ed5d32fd4f..4c3fda8ff8 100644 --- a/test/unit-test/FreeRTOS_ND/FreeRTOS_ND_utest.c +++ b/test/unit-test/FreeRTOS_ND/FreeRTOS_ND_utest.c @@ -2139,13 +2139,3 @@ void test_xCheckRequiresNDResolution_AssertInvalidFrameType( void ) catch_assert( xCheckRequiresNDResolution( pxNetworkBuffer ) ); } - -/** - * @brief Toggle vNDSendUnsolicited. - */ -void test_vNDSendUnsolicited( void ) -{ - xSendEventToIPTask_ExpectAndReturn( eNDTimerEvent, 0 ); - - vNDSendUnsolicited(); -}