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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user