fixeria has uploaded this change for review.

View Change

fix xua_msg_dump(): convert message length to the host's byte order

This fixes bogus messages like this one:

Received MGMT_ERR 'Invalid Routing Context':
HDR=(MGMT:ERROR,V=1,LEN=268435456), PART(T=Error Code,L=4,D=00000019)
^^^^^^^^^^^^^

Change-Id: I516e486fb7b51a25e33965ed5a0f12ab4488d240
---
M src/xua_msg.c
1 file changed, 16 insertions(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/96/35996/1
diff --git a/src/xua_msg.c b/src/xua_msg.c
index 5671e1a..067c8dd 100644
--- a/src/xua_msg.c
+++ b/src/xua_msg.c
@@ -531,7 +531,7 @@
buf[0] = '\0';

OSMO_STRBUF_PRINTF(sb, "HDR=(%s,V=%u,LEN=%u)", xua_hdr_dump(xua, dialect),
- xua->hdr.version, xua->hdr.msg_length);
+ xua->hdr.version, ntohl(xua->hdr.msg_length));

llist_for_each_entry(part, &xua->headers, entry)
OSMO_STRBUF_PRINTF(sb, ", PART(T=%s,L=%u,D=%s)",

To view, visit change 35996. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I516e486fb7b51a25e33965ed5a0f12ab4488d240
Gerrit-Change-Number: 35996
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-MessageType: newchange