diff options
author | Martin Willi <martin@revosec.ch> | 2011-11-21 10:10:48 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-03-20 17:30:44 +0100 |
commit | 4ea258538e396949b6c8c626e80bf8cc3c191dc3 (patch) | |
tree | 82c725efe01b01eae98fed277855a7d4409d8644 /src | |
parent | 5789320f5c34b07a1ea36543f43922ec3fb9fd2d (diff) | |
download | strongswan-4ea258538e396949b6c8c626e80bf8cc3c191dc3.tar.bz2 strongswan-4ea258538e396949b6c8c626e80bf8cc3c191dc3.tar.xz |
Update header length after each parsed rule, as it might change when parsing SPI size
Diffstat (limited to 'src')
-rw-r--r-- | src/libcharon/encoding/parser.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libcharon/encoding/parser.c b/src/libcharon/encoding/parser.c index e599b84d9..39ce2db67 100644 --- a/src/libcharon/encoding/parser.c +++ b/src/libcharon/encoding/parser.c @@ -380,12 +380,13 @@ METHOD(parser_t, parse_payload, status_t, /* base pointer for output, avoids casting in every rule */ output = pld; - - header_length = pld->get_header_length(pld); /* parse the payload with its own rulse */ rule_count = pld->get_encoding_rules(pld, &this->rules); for (rule_number = 0; rule_number < rule_count; rule_number++) { + /* update header length for each rule, as it is dynamic (SPIs) */ + header_length = pld->get_header_length(pld); + rule = &(this->rules[rule_number]); DBG2(DBG_ENC, " parsing rule %d %N", rule_number, encoding_type_names, rule->type); |