Skip to content

Commit 950f180

Browse files
authored
Merge branch 'dev/IPv6_integration' into dev-defines
2 parents fd8b869 + 525a420 commit 950f180

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

source/FreeRTOS_Sockets.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5486,7 +5486,7 @@ BaseType_t xSocketSetSocketID( const Socket_t xSocket,
54865486
FreeRTOS_Socket_t * pxSocket = ( FreeRTOS_Socket_t * ) xSocket;
54875487
BaseType_t xReturn = -pdFREERTOS_ERRNO_EINVAL;
54885488

5489-
if( xSocketValid( pxSocket ) )
5489+
if( xSocketValid( pxSocket ) == pdTRUE )
54905490
{
54915491
xReturn = 0;
54925492
pxSocket->pvSocketID = pvSocketID;
@@ -5508,7 +5508,7 @@ void * pvSocketGetSocketID( const ConstSocket_t xSocket )
55085508
const FreeRTOS_Socket_t * pxSocket = ( const FreeRTOS_Socket_t * ) xSocket;
55095509
void * pvReturn = NULL;
55105510

5511-
if( xSocketValid( pxSocket ) )
5511+
if( xSocketValid( pxSocket ) == pdTRUE )
55125512
{
55135513
pvReturn = pxSocket->pvSocketID;
55145514
}

source/FreeRTOS_UDP_IPv6.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,17 @@ BaseType_t xProcessReceivedUDPPacket_IPv6( NetworkBufferDescriptor_t * pxNetwork
446446

447447
do
448448
{
449+
/* UDPv6 doesn't allow zero-checksum, refer to RFC2460 - section 8.1.
450+
* Some platforms (such as Zynq) pass the packet to upper layer for flexibility to allow zero-checksum. */
451+
if( pxUDPPacket_IPv6->xUDPHeader.usChecksum == 0U )
452+
{
453+
FreeRTOS_debug_printf( ( "xProcessReceivedUDPPacket_IPv6: Drop packets with checksum %d\n",
454+
pxUDPPacket_IPv6->xUDPHeader.usChecksum ) );
455+
456+
xReturn = pdFAIL;
457+
break;
458+
}
459+
449460
if( pxSocket != NULL )
450461
{
451462
if( xCheckRequiresARPResolution( pxNetworkBuffer ) == pdTRUE )

0 commit comments

Comments
 (0)