{
if (this->type == DELETE)
{
- return 8;
+ return 8 + this->spi_size;
}
- return 12;
+ return 12 + this->spi_size;
}
METHOD(payload_t, get_payload_type, payload_type_t,
case PROTO_ESP:
this->spi_count++;
this->payload_length += sizeof(spi);
+ this->spi_size += sizeof(spi);
this->spis = chunk_cat("mc", this->spis, chunk_from_thing(spi));
break;
default:
.destroy = _destroy,
},
.next_payload = NO_PAYLOAD,
- .payload_length = get_header_length(this),
.doi = IKEV1_DOI_IPSEC,
.protocol_id = protocol_id,
.spi_size = protocol_id == PROTO_AH || protocol_id == PROTO_ESP ? 4 : 0,
.type = type,
);
+ this->payload_length = get_header_length(this);
+
return &this->public;
}