Skip to content

Commit

Permalink
Code review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
ActoryOu committed Oct 17, 2024
1 parent 5e842c6 commit 698f2c3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 50 deletions.
44 changes: 22 additions & 22 deletions source/FreeRTOS_IP.c
Original file line number Diff line number Diff line change
Expand Up @@ -1777,9 +1777,9 @@ static void prvProcessEthernetPacket( NetworkBufferDescriptor_t * const pxNetwor

case eWaitingResolution:

#if ipconfigIS_ENABLED( ipconfigUSE_IPv4 )
if( ( pxEthernetHeader->usFrameType == ipIPv4_FRAME_TYPE ) || ( pxEthernetHeader->usFrameType == ipARP_FRAME_TYPE ) )
{
if( ( pxEthernetHeader->usFrameType == ipIPv4_FRAME_TYPE ) || ( pxEthernetHeader->usFrameType == ipARP_FRAME_TYPE ) )
{
#if ipconfigIS_ENABLED( ipconfigUSE_IPv4 )
if( pxARPWaitingNetworkBuffer == NULL )
{
pxARPWaitingNetworkBuffer = pxNetworkBuffer;
Expand All @@ -1788,20 +1788,20 @@ static void prvProcessEthernetPacket( NetworkBufferDescriptor_t * const pxNetwor
iptraceDELAYED_ARP_REQUEST_STARTED();
}
else
{
/* We are already waiting on one resolution. This frame will be dropped. */
vReleaseNetworkBufferAndDescriptor( pxNetworkBuffer );

iptraceDELAYED_ARP_BUFFER_FULL();
}
#endif /* if ipconfigIS_ENABLED( ipconfigUSE_IPv4 ) */
{
/* We are already waiting on one resolution. This frame will be dropped. */
vReleaseNetworkBufferAndDescriptor( pxNetworkBuffer );

break;
iptraceDELAYED_ARP_BUFFER_FULL();
}
#endif /* if ipconfigIS_ENABLED( ipconfigUSE_IPv4 ) */

#if ipconfigIS_ENABLED( ipconfigUSE_IPv6 )
if( pxEthernetHeader->usFrameType == ipIPv6_FRAME_TYPE )
{
break;
}

if( pxEthernetHeader->usFrameType == ipIPv6_FRAME_TYPE )
{
#if ipconfigIS_ENABLED( ipconfigUSE_IPv6 )
if( pxNDWaitingNetworkBuffer == NULL )
{
pxNDWaitingNetworkBuffer = pxNetworkBuffer;
Expand All @@ -1810,16 +1810,16 @@ static void prvProcessEthernetPacket( NetworkBufferDescriptor_t * const pxNetwor
iptraceDELAYED_ND_REQUEST_STARTED();
}
else
{
/* We are already waiting on one resolution. This frame will be dropped. */
vReleaseNetworkBufferAndDescriptor( pxNetworkBuffer );

iptraceDELAYED_ND_BUFFER_FULL();
}
#endif /* if ipconfigIS_ENABLED( ipconfigUSE_IPv6 ) */
{
/* We are already waiting on one resolution. This frame will be dropped. */
vReleaseNetworkBufferAndDescriptor( pxNetworkBuffer );

break;
iptraceDELAYED_ND_BUFFER_FULL();
}
#endif /* if ipconfigIS_ENABLED( ipconfigUSE_IPv6 ) */

break;
}

break;

Expand Down
28 changes: 0 additions & 28 deletions test.sh

This file was deleted.

0 comments on commit 698f2c3

Please sign in to comment.