From: Martin Willi Date: Tue, 13 Dec 2011 10:30:35 +0000 (+0100) Subject: Fixed SPI size calculation in DELETE payload X-Git-Tag: 5.0.0~338^2~9^2~237 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=226b0f36c74f7739dbf498ad0093e9e208a7db6f;p=thirdparty%2Fstrongswan.git Fixed SPI size calculation in DELETE payload --- diff --git a/src/libcharon/encoding/payloads/delete_payload.c b/src/libcharon/encoding/payloads/delete_payload.c index 3222e9fbea..dec1ba72af 100644 --- a/src/libcharon/encoding/payloads/delete_payload.c +++ b/src/libcharon/encoding/payloads/delete_payload.c @@ -264,7 +264,6 @@ METHOD(delete_payload_t, add_spi, void, 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: @@ -362,17 +361,17 @@ delete_payload_t *delete_payload_create(payload_type_t type, ); this->payload_length = get_header_length(this); - if (type == DELETE_V1) + if (protocol_id == PROTO_IKE) { - if (protocol_id == PROTO_IKE) + if (type == DELETE_V1) { this->spi_size = 16; } - else - { - this->doi = IKEV1_DOI_IPSEC, - this->spi_size = 4; - } + } + else + { + this->doi = IKEV1_DOI_IPSEC, + this->spi_size = 4; } return &this->public; }