Skip to content

Commit b48f1bd

Browse files
Merge branch 'main' into FreeRTOS_MatchingEndpointFix
2 parents 0f8b071 + 9cf8431 commit b48f1bd

File tree

46 files changed

+571
-278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+571
-278
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ jobs:
106106
echo "::endgroup::"
107107
echo -e "${{ env.bashPass }} Built Coverage Tests ${{ env.bashEnd }}"
108108
109-
wget https://github.com/linux-test-project/lcov/releases/download/v2.3.1/lcov-2.3.1.tar.gz
110-
tar -xvzf lcov-2.3.1.tar.gz
111-
./lcov-2.3.1/bin/lcov --list --rc branch_coverage=1 test/unit-test/build/coverage.info
109+
lcov --summary --rc lcov_branch_coverage=1 test/unit-test/build/coverage.info
112110
113111
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
114112
@@ -303,6 +301,20 @@ jobs:
303301
echo "::endgroup::"
304302
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
305303
304+
- env:
305+
stepName: Build checks (Disable DNS features)
306+
name: ${{ env.stepName }}
307+
run: |
308+
# ${{ env.stepName }}
309+
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
310+
311+
cmake -S . -B build -DFREERTOS_PLUS_TCP_ENABLE_BUILD_CHECKS=ON -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=DISABLE_DNS_FEATURES
312+
cmake --build build --target clean
313+
cmake --build build --target freertos_plus_tcp_build_test
314+
315+
echo "::endgroup::"
316+
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
317+
306318
- env:
307319
stepName: Build checks (Disable all functionalities)
308320
name: ${{ env.stepName }}

.github/workflows/formatting.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

source/FreeRTOS_DNS_Cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
pxIP->xIPAddress.ulIP_IPv4 = 0U;
221221
}
222222

223-
ulCurrentTimeSeconds = ( uint32_t ) ( ( xCurrentTickCount / portTICK_PERIOD_MS ) / 1000U );
223+
ulCurrentTimeSeconds = ( uint32_t ) ( ( xCurrentTickCount / configTICK_RATE_HZ ) );
224224
xResult = prvFindEntryIndex( pcName, pxIP, &uxIndex );
225225

226226
if( xResult == pdTRUE )

source/FreeRTOS_DNS_Callback.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
* @param[in] pcHostName The hostname whose IP address is being searched for.
126126
* @param[in] pvSearchID The search ID of the DNS callback function to set.
127127
* @param[in] pCallbackFunction The callback function pointer.
128-
* @param[in] uxTimeout Timeout of the callback function.
128+
* @param[in] uxTimeout Timeout of the callback function in ms.
129129
* @param[in] uxIdentifier Random number used as ID in the DNS message.
130130
* @param[in] xIsIPv6 pdTRUE if the address type should be IPv6.
131131
*/
@@ -145,7 +145,7 @@
145145
DNSCallback_t * pxCallback = ( ( DNSCallback_t * ) pvPortMalloc( sizeof( *pxCallback ) + lLength ) );
146146

147147
/* Translate from ms to number of clock ticks. */
148-
uxTimeout /= portTICK_PERIOD_MS;
148+
uxTimeout = pdMS_TO_TICKS( uxTimeout );
149149

150150
if( pxCallback != NULL )
151151
{

source/FreeRTOS_DNS_Parser.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -737,10 +737,12 @@
737737
&( pxSet->pucByte[ sizeof( DNSAnswerRecord_t ) ] ),
738738
ipSIZE_OF_IPv6_ADDRESS );
739739

740-
if( ppxAddressInfo != NULL )
741-
{
742-
pxNewAddress = pxNew_AddrInfo( pxSet->pcName, FREERTOS_AF_INET6, xIP_Address.xIPAddress.xIP_IPv6.ucBytes );
743-
}
740+
#if ( ( ipconfigUSE_DNS_CACHE != 0 ) || ( ipconfigDNS_USE_CALLBACKS != 0 ) || ( ipconfigUSE_MDNS != 0 ) || ( ipconfigUSE_LLMNR != 0 ) )
741+
if( ppxAddressInfo != NULL )
742+
{
743+
pxNewAddress = pxNew_AddrInfo( pxSet->pcName, FREERTOS_AF_INET6, xIP_Address.xIPAddress.xIP_IPv6.ucBytes );
744+
}
745+
#endif
744746

745747
xIP_Address.xIs_IPv6 = pdTRUE;
746748

@@ -765,12 +767,14 @@
765767
pvCopyDest = &( pxSet->ulIPAddress );
766768
( void ) memcpy( pvCopyDest, pvCopySource, pxSet->uxAddressLength );
767769

768-
if( ppxAddressInfo != NULL )
769-
{
770-
const uint8_t * ucBytes = ( uint8_t * ) &( pxSet->ulIPAddress );
770+
#if ( ( ipconfigUSE_DNS_CACHE != 0 ) || ( ipconfigDNS_USE_CALLBACKS != 0 ) || ( ipconfigUSE_MDNS != 0 ) || ( ipconfigUSE_LLMNR != 0 ) )
771+
if( ppxAddressInfo != NULL )
772+
{
773+
const uint8_t * ucBytes = ( uint8_t * ) &( pxSet->ulIPAddress );
771774

772-
pxNewAddress = pxNew_AddrInfo( pxSet->pcName, FREERTOS_AF_INET4, ucBytes );
773-
}
775+
pxNewAddress = pxNew_AddrInfo( pxSet->pcName, FREERTOS_AF_INET4, ucBytes );
776+
}
777+
#endif
774778

775779
xIP_Address.xIPAddress.ulIP_IPv4 = pxSet->ulIPAddress;
776780
xIP_Address.xIs_IPv6 = pdFALSE;

source/FreeRTOS_Sockets.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3900,12 +3900,6 @@ void vSocketWakeUpUser( FreeRTOS_Socket_t * pxSocket )
39003900
if( pxParentSocket->u.xTCP.bits.bReuseSocket == pdFALSE_UNSIGNED )
39013901
{
39023902
pxClientSocket = pxParentSocket->u.xTCP.pxPeerSocket;
3903-
3904-
if( pxClientSocket != NULL )
3905-
{
3906-
FreeRTOS_printf( ( "prvAcceptWaitClient: client %p parent %p\n",
3907-
( void * ) pxClientSocket, ( void * ) pxParentSocket ) );
3908-
}
39093903
}
39103904
else
39113905
{
@@ -3932,6 +3926,12 @@ void vSocketWakeUpUser( FreeRTOS_Socket_t * pxSocket )
39323926
}
39333927
( void ) xTaskResumeAll();
39343928

3929+
if( ( pxClientSocket != NULL ) && ( pxParentSocket->u.xTCP.bits.bReuseSocket == pdFALSE_UNSIGNED ) )
3930+
{
3931+
FreeRTOS_printf( ( "prvAcceptWaitClient: client %p parent %p\n",
3932+
( void * ) pxClientSocket, ( void * ) pxParentSocket ) );
3933+
}
3934+
39353935
if( pxClientSocket != NULL )
39363936
{
39373937
if( pxAddressLength != NULL )

source/FreeRTOS_TCP_WIN.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@
374374
TickType_t uxNow = xTaskGetTickCount();
375375
TickType_t uxDiff = uxNow - pxTimer->uxBorn;
376376

377-
return ( uint32_t ) ( uxDiff * portTICK_PERIOD_MS );
377+
return ( uint32_t ) pdTICKS_TO_MS( uxDiff );
378378
}
379379
/*-----------------------------------------------------------*/
380380

source/FreeRTOS_Tiny_TCP.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
TickType_t uxNow = xTaskGetTickCount();
125125
TickType_t uxDiff = uxNow - pxTimer->uxBorn;
126126

127-
return uxDiff * portTICK_PERIOD_MS;
127+
return pdTICKS_TO_MS( uxDiff );
128128
}
129129
/*-----------------------------------------------------------*/
130130

source/FreeRTOS_UDP_IPv4.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ void vProcessGeneratedUDPPacket_IPv4( NetworkBufferDescriptor_t * const pxNetwor
273273

274274
/* 'ulIPAddress' might have become the address of the Gateway.
275275
* Find the route again. */
276-
277-
pxNetworkBuffer->pxEndPoint = FreeRTOS_FindEndPointOnNetMask( pxNetworkBuffer->xIPAddress.ulIP_IPv4 );
276+
pxNetworkBuffer->pxEndPoint = FreeRTOS_FindEndPointOnNetMask( ulIPAddress );
278277

279278
if( pxNetworkBuffer->pxEndPoint == NULL )
280279
{

source/include/FreeRTOSIPConfigDefaults.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
* Type: TickType_t
309309
* Unit: milliseconds
310310
* Minimum: 0
311-
* Maximum: portMAX_DELAY * portTICK_PERIOD_MS
311+
* Maximum: ( portMAX_DELAY / configTICK_RATE_HZ ) * 1000
312312
*
313313
* Sets the timeout to wait for a response to a router
314314
* solicitation message.
@@ -322,7 +322,7 @@
322322
#error ipconfigRA_SEARCH_TIME_OUT_MSEC must be at least 0
323323
#endif
324324

325-
STATIC_ASSERT( ipconfigRA_SEARCH_TIME_OUT_MSEC <= ( portMAX_DELAY * portTICK_PERIOD_MS ) );
325+
STATIC_ASSERT( pdMS_TO_TICKS( ipconfigRA_SEARCH_TIME_OUT_MSEC ) <= portMAX_DELAY );
326326

327327
/*---------------------------------------------------------------------------*/
328328

@@ -357,7 +357,7 @@ STATIC_ASSERT( ipconfigRA_SEARCH_TIME_OUT_MSEC <= ( portMAX_DELAY * portTICK_PER
357357
* Type: TickType_t
358358
* Unit: milliseconds
359359
* Minimum: 0
360-
* Maximum: portMAX_DELAY * portTICK_PERIOD_MS
360+
* Maximum: ( portMAX_DELAY / configTICK_RATE_HZ ) * 1000
361361
*
362362
* Sets the timeout to wait for a response to a neighbour solicitation message.
363363
*/
@@ -370,7 +370,7 @@ STATIC_ASSERT( ipconfigRA_SEARCH_TIME_OUT_MSEC <= ( portMAX_DELAY * portTICK_PER
370370
#error ipconfigRA_IP_TEST_TIME_OUT_MSEC must be at least 0
371371
#endif
372372

373-
STATIC_ASSERT( ipconfigRA_IP_TEST_TIME_OUT_MSEC <= ( portMAX_DELAY * portTICK_PERIOD_MS ) );
373+
STATIC_ASSERT( pdMS_TO_TICKS( ipconfigRA_IP_TEST_TIME_OUT_MSEC ) <= portMAX_DELAY );
374374

375375
/*---------------------------------------------------------------------------*/
376376

@@ -1726,8 +1726,7 @@ STATIC_ASSERT( ipconfigTCP_KEEP_ALIVE_INTERVAL <= ( portMAX_DELAY / configTICK_R
17261726
* network buffers are themselves blocked waiting for a network buffer.
17271727
*
17281728
* ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in
1729-
* milliseconds can be converted to a time in ticks by dividing the time in
1730-
* milliseconds by portTICK_PERIOD_MS.
1729+
* milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().
17311730
*/
17321731

17331732
#ifndef ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS

0 commit comments

Comments
 (0)