mirror of
https://github.com/mfontanini/libtins
synced 2026-01-29 04:54:28 +01:00
Fixed bug on IP when serializing fragmented packets.
The original protocol id was being overwritten with 0xff(unknown) when the inner_pdu was a RawPDU, even if it was just a fragment of a transport layer PDU. The protocol id is now kept if the packet is fragmented.
This commit is contained in:
11
include/ip.h
11
include/ip.h
@@ -364,6 +364,17 @@ namespace Tins {
|
||||
/**
|
||||
* \brief Setter for the protocol field.
|
||||
*
|
||||
* Note that this protocol will be overwritten using the
|
||||
* inner_pdu's protocol type during serialization unless the IP
|
||||
* datagram is fragmented.
|
||||
*
|
||||
* If the packet is fragmented and was originally sniffed, the
|
||||
* original protocol type will be kept when serialized.
|
||||
*
|
||||
* If this packet has been crafted manually and the inner_pdu
|
||||
* is, for example, a RawPDU, then setting the protocol yourself
|
||||
* is necessary.
|
||||
*
|
||||
* \param new_protocol The new protocol.
|
||||
*/
|
||||
void protocol(uint8_t new_protocol);
|
||||
|
||||
Reference in New Issue
Block a user