mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Accept packets that use tcp segment offloading.
When checksum offloading is enabled, we now forward packets that have 0 header lengths set - and assume that they have TSO enabled. If checksum offloading is not enabled, we drop the packets. Addresses GH-1829
This commit is contained in:
parent
20d1b89caa
commit
e14b695497
5 changed files with 20 additions and 6 deletions
6
src/IP.h
6
src/IP.h
|
@ -415,7 +415,11 @@ public:
|
|||
uint16_t PayloadLen() const
|
||||
{
|
||||
if ( ip4 )
|
||||
return ntohs(ip4->ip_len) - ip4->ip_hl * 4;
|
||||
{
|
||||
// prevent overflow in case of segment offloading/zeroed header length.
|
||||
auto total_len = ntohs(ip4->ip_len);
|
||||
return total_len ? total_len - ip4->ip_hl * 4 : 0;
|
||||
}
|
||||
|
||||
return ntohs(ip6->ip6_plen) + 40 - ip6_hdrs->TotalLength();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue