1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-26 03:51:35 +01:00

Fix IP fragment reassemble when packet has flags DF+MF

This commit is contained in:
Matias Fontanini
2016-02-21 09:23:44 -08:00
parent 8812153491
commit 9dabb6f570
3 changed files with 31 additions and 2 deletions

View File

@@ -55,7 +55,8 @@ void IPv4Stream::add_fragment(IP* ip) {
}
fragments_.insert(it, IPv4Fragment(ip->inner_pdu(), offset));
received_size_ += ip->inner_pdu()->size();
if (ip->flags() != IP::MORE_FRAGMENTS) {
// If the MF flag is off
if ((ip->flags() & IP::MORE_FRAGMENTS) == 0) {
total_size_ = offset + ip->inner_pdu()->size();
received_end_ = true;
}