Skip to content

Commit

Permalink
fix bug: Only send packet when packetlength>=Etherheader(14)+IPv4head…
Browse files Browse the repository at this point in the history
…er(20), but some Ether Packets have no IP header
  • Loading branch information
Jimmy01240397 authored and lstipakov committed Apr 25, 2023
1 parent b2aeda5 commit d9fbdce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/txpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,10 +902,10 @@ Return Value:

packetLength = NET_BUFFER_DATA_LENGTH(currentNb);

// Minimum packet size is size of Ethernet plus IPv4 headers.
ASSERT(packetLength >= (ETHERNET_HEADER_SIZE + IP_HEADER_SIZE));
// Minimum packet size is size of Ethernet.
ASSERT(packetLength >= ETHERNET_HEADER_SIZE);

if(packetLength < (ETHERNET_HEADER_SIZE + IP_HEADER_SIZE))
if(packetLength < ETHERNET_HEADER_SIZE)
{
return FALSE;
}
Expand Down

0 comments on commit d9fbdce

Please sign in to comment.