Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions source/FreeRTOS_IP.c
Original file line number Diff line number Diff line change
Expand Up @@ -1651,8 +1651,8 @@ static eFrameProcessingResult_t prvProcessIPPacket( IPPacket_t * pxIPPacket,
pxIPHeader->usLength = FreeRTOS_htons( FreeRTOS_ntohs( pxIPHeader->usLength ) - optlen );

/* Rewrite the Version/IHL byte to indicate that this packet has no IP options. */
pxIPHeader->ucVersionHeaderLength = ( pxIPHeader->ucVersionHeaderLength & 0xF0U ) | /* High nibble is the version. */
( ( ipSIZE_OF_IPv4_HEADER >> 2 ) & 0x0FU );
pxIPHeader->ucVersionHeaderLength = ( uint8_t )( ( pxIPHeader->ucVersionHeaderLength & 0xF0U ) | /* High nibble is the version. */
( ( ipSIZE_OF_IPv4_HEADER >> 2 ) & 0x0FU ) );
}
#else /* if ( ipconfigIP_PASS_PACKETS_WITH_IP_OPTIONS != 0 ) */
{
Expand Down
2 changes: 1 addition & 1 deletion source/FreeRTOS_Sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -1878,7 +1878,7 @@ BaseType_t FreeRTOS_setsockopt( Socket_t xSocket,

if( pvOptionValue == NULL )
{
pxSocket->ucSocketOptions &= ~( ( uint8_t ) FREERTOS_SO_UDPCKSUM_OUT );
pxSocket->ucSocketOptions &= ( uint8_t )(~FREERTOS_SO_UDPCKSUM_OUT);
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions source/FreeRTOS_TCP_Reception.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,14 @@
*/
if( pucPtr[ 0U ] == tcpTCP_OPT_SACK_A )
{
ucLen -= 2U;
ucLen -= 2;
Copy link
Member

Choose a reason for hiding this comment

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

I am unsure about this change. ucLen is unsigned. Then while assigning 2 to it, why not make 2 explicitly signed by using U?

Copy link
Member

Choose a reason for hiding this comment

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

This will also give MISRA violation.

lIndex += 2;

while( ucLen >= ( uint8_t ) 8U )
{
prvReadSackOption( pucPtr, ( size_t ) lIndex, pxSocket );
lIndex += 8;
ucLen -= 8U;
ucLen -= 8;
Copy link
Member

Choose a reason for hiding this comment

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

This is not solving the issue . Earlier warning was "conversion from ‘unsigned int’ to ‘uint8_t’" with your fix the warning has now changed to conversion from ‘int’ to ‘uint8_t’

}

/* ucLen should be 0 by now. */
Expand Down