diff options
Diffstat (limited to 'src/libcharon/encoding/payloads/configuration_attribute.c')
-rw-r--r-- | src/libcharon/encoding/payloads/configuration_attribute.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libcharon/encoding/payloads/configuration_attribute.c b/src/libcharon/encoding/payloads/configuration_attribute.c index a657ef13a..8746b9b9e 100644 --- a/src/libcharon/encoding/payloads/configuration_attribute.c +++ b/src/libcharon/encoding/payloads/configuration_attribute.c @@ -161,6 +161,12 @@ METHOD(payload_t, get_encoding_rules, int, return countof(encodings); } +METHOD(payload_t, get_header_length, int, + private_configuration_attribute_t *this) +{ + return 4; +} + METHOD(payload_t, get_type, payload_type_t, private_configuration_attribute_t *this) { @@ -181,7 +187,7 @@ METHOD(payload_t, set_next_type, void, METHOD(payload_t, get_length, size_t, private_configuration_attribute_t *this) { - return this->value.len + CONFIGURATION_ATTRIBUTE_HEADER_LENGTH; + return get_header_length(this) + this->value.len; } METHOD(configuration_attribute_t, get_cattr_type, configuration_attribute_type_t, @@ -215,6 +221,7 @@ configuration_attribute_t *configuration_attribute_create() .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, |