diff options
Diffstat (limited to 'src/libcharon/encoding/payloads/cp_payload.c')
-rw-r--r-- | src/libcharon/encoding/payloads/cp_payload.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libcharon/encoding/payloads/cp_payload.c b/src/libcharon/encoding/payloads/cp_payload.c index 4e782dd88..05f16c33f 100644 --- a/src/libcharon/encoding/payloads/cp_payload.c +++ b/src/libcharon/encoding/payloads/cp_payload.c @@ -149,6 +149,12 @@ METHOD(payload_t, get_encoding_rules, int, return countof(encodings); } +METHOD(payload_t, get_header_length, int, + private_cp_payload_t *this) +{ + return 8; +} + METHOD(payload_t, get_type, payload_type_t, private_cp_payload_t *this) { @@ -175,7 +181,7 @@ static void compute_length(private_cp_payload_t *this) enumerator_t *enumerator; payload_t *attribute; - this->payload_length = CP_PAYLOAD_HEADER_LENGTH; + this->payload_length = get_header_length(this); enumerator = this->attributes->create_enumerator(this->attributes); while (enumerator->enumerate(enumerator, &attribute)) @@ -230,6 +236,7 @@ cp_payload_t *cp_payload_create_type(config_type_t type) .payload_interface = { .verify = _verify, .get_encoding_rules = _get_encoding_rules, + .get_header_length = _get_header_length, .get_length = _get_length, .get_next_type = _get_next_type, .set_next_type = _set_next_type, @@ -242,7 +249,7 @@ cp_payload_t *cp_payload_create_type(config_type_t type) .destroy = _destroy, }, .next_payload = NO_PAYLOAD, - .payload_length = CP_PAYLOAD_HEADER_LENGTH, + .payload_length = get_header_length(this), .attributes = linked_list_create(), .type = type, ); |