aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/encoding
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-08-01 11:27:25 +0200
committerMartin Willi <martin@revosec.ch>2011-08-03 12:01:15 +0200
commit61e13630f82f76dc7a2ef8a42eef188315b53d9b (patch)
treebd07fc302709c1ca22e0d22f2d75144c748f2d59 /src/libcharon/encoding
parent06912a5eb410720d49eaa8a33b64240cdc4223c8 (diff)
downloadstrongswan-61e13630f82f76dc7a2ef8a42eef188315b53d9b.tar.bz2
strongswan-61e13630f82f76dc7a2ef8a42eef188315b53d9b.tar.xz
Show error code of Microsoft specific error notify
Diffstat (limited to 'src/libcharon/encoding')
-rw-r--r--src/libcharon/encoding/message.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/libcharon/encoding/message.c b/src/libcharon/encoding/message.c
index e0fecef10..35a91c9ab 100644
--- a/src/libcharon/encoding/message.c
+++ b/src/libcharon/encoding/message.c
@@ -861,9 +861,23 @@ static char* get_string(private_message_t *this, char *buf, int len)
len -= written;
if (payload->get_type(payload) == NOTIFY)
{
- notify_payload_t *notify = (notify_payload_t*)payload;
- written = snprintf(pos, len, "(%N)", notify_type_short_names,
- notify->get_notify_type(notify));
+ notify_payload_t *notify;
+ notify_type_t type;
+ chunk_t data;
+
+ notify = (notify_payload_t*)payload;
+ type = notify->get_notify_type(notify);
+ data = notify->get_notification_data(notify);
+ if (type == MS_NOTIFY_STATUS && data.len == 4)
+ {
+ written = snprintf(pos, len, "(%N(%d))", notify_type_short_names,
+ type, untoh32(data.ptr));
+ }
+ else
+ {
+ written = snprintf(pos, len, "(%N)", notify_type_short_names,
+ type);
+ }
if (written >= len || written < 0)
{
return buf;