Skip to content

Commit

Permalink
Define macro to check ethernet frame type.
Browse files Browse the repository at this point in the history
  • Loading branch information
ActoryOu committed Jul 31, 2024
1 parent 982c47d commit 39d6a18
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/FreeRTOS_IP.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@
#endif
#endif

/** @brief The frame type field in the Ethernet header must have a value greater than 0x0600.
* If the configuration option ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES is enabled, the stack
* will discard packets with a frame type value less than or equal to 0x0600.
* However, if this option is disabled, the stack will continue to process these packets. */
#define ipIS_ETHERNET_FRAME_TYPE_INVALID( usFrameType ) ( ( usFrameType ) <= 0x0600U )

static void prvCallDHCP_RA_Handler( NetworkEndPoint_t * pxEndPoint );

static void prvIPTask_Initialise( void );
Expand Down Expand Up @@ -1460,7 +1466,8 @@ eFrameProcessingResult_t eConsiderFrameForProcessing( const uint8_t * const pucE
usFrameType = pxEthernetHeader->usFrameType;

/* Second, filter based on ethernet frame type. */
if( FreeRTOS_ntohs( usFrameType ) <= 0x0600U )
/* The frame type field in the Ethernet header must have a value greater than 0x0600. */
if( ipIS_ETHERNET_FRAME_TYPE_INVALID( FreeRTOS_ntohs( usFrameType ) ) )
{
/* The packet was not an Ethernet II frame */
#if ipconfigIS_ENABLED( ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES )
Expand Down

0 comments on commit 39d6a18

Please sign in to comment.