1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Perserve IP protocol when using RawPDU

Previously, the IP protocol field for non-fragmented packets was forcibly overwritten to the protocol of the inner PDU even if that PDU was a RawPDU. This behavior contradicts the documentation.
This commit is contained in:
Ben McMorran
2015-04-20 02:45:27 -04:00
parent 530ac79ba4
commit eb5598be7c

View File

@@ -385,7 +385,7 @@ void IP::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU* pare
Internals::pdu_type_to_id<IP>(inner_pdu()->pdu_type())
);
}
if(!is_fragmented() || new_flag != 0xff)
if(!is_fragmented() && new_flag != 0xff)
protocol(new_flag);
}