Skip to content

Commit

Permalink
pass payload length when calling UDP callback (#30)
Browse files Browse the repository at this point in the history
* pass payload length when calling UDP callback
  • Loading branch information
AniruddhaKanhere committed Mar 9, 2020
1 parent 12d580e commit c40a6da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/FreeRTOS_UDP_IP.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ UDPPacket_t *pxUDPPacket = (UDPPacket_t *) pxNetworkBuffer->pucEthernetBuffer;
destinationAddress.sin_port = usPort;
destinationAddress.sin_addr = pxUDPPacket->xIPHeader.ulDestinationIPAddress;

if( xHandler( ( Socket_t ) pxSocket, ( void* ) pcData, ( size_t ) pxNetworkBuffer->xDataLength,
/* The value of 'xDataLength' was proven to be at least the size of a UDP packet in prvProcessIPPacket(). */
if( xHandler( ( Socket_t ) pxSocket, ( void* ) pcData, ( size_t ) ( pxNetworkBuffer->xDataLength - ipUDP_PAYLOAD_OFFSET_IPv4 ),
&xSourceAddress, &destinationAddress ) )
{
xReturn = pdFAIL; /* FAIL means that we did not consume or release the buffer */
Expand Down

0 comments on commit c40a6da

Please sign in to comment.