diff options
author | Martin Willi <martin@strongswan.org> | 2005-11-18 16:29:14 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2005-11-18 16:29:14 +0000 |
commit | daa1c00e9f8cb62086a5a60a28d17459ef85205d (patch) | |
tree | c98a57a15217bd5649703c810890053d941bcee2 /Source/charon/message.c | |
parent | 90ef6620a2c9c213c21760d237b9f8f3501125ff (diff) | |
download | strongswan-daa1c00e9f8cb62086a5a60a28d17459ef85205d.tar.bz2 strongswan-daa1c00e9f8cb62086a5a60a28d17459ef85205d.tar.xz |
- baschtel
- works initiating, results in shared secret
Diffstat (limited to 'Source/charon/message.c')
-rw-r--r-- | Source/charon/message.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/charon/message.c b/Source/charon/message.c index c0618c800..0e6710982 100644 --- a/Source/charon/message.c +++ b/Source/charon/message.c @@ -369,7 +369,8 @@ static exchange_type_t get_request (private_message_t *this) static status_t add_payload(private_message_t *this, payload_t *payload) { payload_t *last_payload; - if (this->payloads->get_last(this->payloads,(void **) &last_payload) != SUCCESS) + if ((this->payloads->get_count(this->payloads) > 0) && + (this->payloads->get_last(this->payloads,(void **) &last_payload) != SUCCESS)) { return OUT_OF_RES; } @@ -583,18 +584,23 @@ static status_t parse_header (private_message_t *this) */ static status_t parse_body (private_message_t *this) { - status_t status; + status_t status = SUCCESS; int i; payload_type_t current_payload_type = this->first_payload; supported_payload_entry_t *supported_payloads; size_t supported_payloads_count; + if (this->get_supported_payloads (this,&supported_payloads,&supported_payloads_count) != SUCCESS) { + this->logger->log(this->logger, ERROR, "could not get supported payloads"); /* message type is not supported */ return FAILED; } + + this->logger->log(this->logger, ERROR, "first payload %s", mapping_find(payload_type_m, current_payload_type)); + while (current_payload_type != NO_PAYLOAD) { payload_t *current_payload; |