mfontanini / libtins

High-level, multiplatform C++ network packet sniffing and crafting library.
http://libtins.github.io/
BSD 2-Clause "Simplified" License
1.91k stars 377 forks source link

DataTracker::advance_sequence removes too much data #524

Open GreaterThanOrEqual opened 7 months ago

GreaterThanOrEqual commented 7 months ago

I have a case where there are missing packets in my capture. The original tcp stream was fine. I receive server_out_of_order_callback after the missing packet but it may take a while before I realize that the problem is with capture (I track acks on the client flow). The packets are stored in bufferedpayload. The problem is when I call advance_sequence, the first stored packet in bufferedpayload is removed. I think if (seq_compare(it->first, seq) <= 0) in advance_sequence should be if (seq_compare(it->first, seq) < 0)