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

Fixed IP packet.

This commit is contained in:
Matias
2011-08-10 23:27:45 -03:00
parent b0aeea0b02
commit 8dc0a5a832
3 changed files with 25 additions and 5 deletions

View File

@@ -37,10 +37,10 @@ uint8_t *Tins::PDU::serialize(uint32_t &sz) {
void Tins::PDU::serialize(uint8_t *buffer, uint32_t total_sz) {
uint32_t sz = header_size() + trailer_size();
write_serialization(buffer, total_sz);
/* Must not happen... */
assert(total_sz >= sz);
if(_inner_pdu)
_inner_pdu->serialize(buffer + header_size(), total_sz - sz);
write_serialization(buffer, total_sz);
}