diff --git a/src/ip.cpp b/src/ip.cpp index 4637acc..eb759a2 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -448,7 +448,7 @@ bool IP::matches_response(uint8_t *ptr, uint32_t total_sz) { return false; iphdr *ip_ptr = (iphdr*)ptr; if(_ip.daddr == ip_ptr->saddr && _ip.saddr == ip_ptr->daddr) { - uint32_t sz = std::min(_ip.ihl * sizeof(uint32_t), total_sz); + uint32_t sz = std::min(_ip.ihl * sizeof(uint32_t), total_sz); return inner_pdu() ? inner_pdu()->matches_response(ptr + sz, total_sz - sz) : true; } return false; diff --git a/src/tcp.cpp b/src/tcp.cpp index 3bcf5f9..9f15258 100644 --- a/src/tcp.cpp +++ b/src/tcp.cpp @@ -379,7 +379,7 @@ bool TCP::matches_response(uint8_t *ptr, uint32_t total_sz) { return false; const tcphdr *tcp_ptr = (const tcphdr*)ptr; if(tcp_ptr->sport == _tcp.dport && tcp_ptr->dport == _tcp.sport) { - uint32_t sz = std::min(total_sz, tcp_ptr->doff * sizeof(uint32_t)); + uint32_t sz = std::min(total_sz, tcp_ptr->doff * sizeof(uint32_t)); return inner_pdu() ? inner_pdu()->matches_response(ptr + sz, total_sz - sz) : true; } else