aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-11-21 10:10:48 +0100
committerMartin Willi <martin@revosec.ch>2012-03-20 17:30:44 +0100
commit4ea258538e396949b6c8c626e80bf8cc3c191dc3 (patch)
tree82c725efe01b01eae98fed277855a7d4409d8644 /src
parent5789320f5c34b07a1ea36543f43922ec3fb9fd2d (diff)
downloadstrongswan-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.c5
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);