Skip to content

Commit

Permalink
Remove redundant check
Browse files Browse the repository at this point in the history
  • Loading branch information
sashashura committed Nov 13, 2023
1 parent 0e9c0ce commit 76fdad1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Packet++/header/DhcpLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ namespace pcpp
return;
}

if (m_Data == nullptr || m_Data->recordType == (uint8_t)DHCPOPT_END || m_Data->recordType == (uint8_t)DHCPOPT_PAD)
if (m_Data->recordType == (uint8_t)DHCPOPT_END || m_Data->recordType == (uint8_t)DHCPOPT_PAD)
return;

if (tlvDataLen < sizeof(TLVRawData::recordType) + sizeof(TLVRawData::recordLen))
Expand Down
2 changes: 1 addition & 1 deletion Packet++/header/IPv4Layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ namespace pcpp
return;
}

if (m_Data == nullptr || getIPv4OptionType() == (uint8_t)IPV4OPT_EndOfOptionsList || m_Data->recordType == (uint8_t)IPV4OPT_NOP)
if (getIPv4OptionType() == (uint8_t)IPV4OPT_EndOfOptionsList || m_Data->recordType == (uint8_t)IPV4OPT_NOP)
return;

if (tlvDataLen < sizeof(TLVRawData::recordType) + sizeof(TLVRawData::recordLen))
Expand Down
2 changes: 1 addition & 1 deletion Packet++/header/IPv6Extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ namespace pcpp
return;
}

if (m_Data == nullptr || m_Data->recordType == Pad0OptionType)
if (m_Data->recordType == Pad0OptionType)
return;

if (tlvDataLen < sizeof(TLVRawData::recordType) + sizeof(TLVRawData::recordLen))
Expand Down
2 changes: 1 addition & 1 deletion Packet++/header/TcpLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ namespace pcpp
return;
}

if (m_Data == nullptr || m_Data->recordType == (uint8_t)PCPP_TCPOPT_NOP || m_Data->recordType == (uint8_t)PCPP_TCPOPT_EOL)
if (m_Data->recordType == (uint8_t)PCPP_TCPOPT_NOP || m_Data->recordType == (uint8_t)PCPP_TCPOPT_EOL)
return;

if (tlvDataLen < sizeof(TLVRawData::recordType) + sizeof(TLVRawData::recordLen))
Expand Down

0 comments on commit 76fdad1

Please sign in to comment.