aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-01-01 12:00:38 +0100
committerHarald Welte <laforge@gnumonks.org>2017-01-01 19:51:50 +0100
commit7af93aacbae643349739df4da228b4980b22b9bd (patch)
treefe0f867c5dd079bff1e863a80a3c5da8869d6e1b
parentf6bd58c7fb401ec8561ba480ac9489852e163707 (diff)
diag_msg: endian fixes
-rw-r--r--src/diag_msg.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/diag_msg.c b/src/diag_msg.c
index 47c3c86..f3b9c5d 100644
--- a/src/diag_msg.c
+++ b/src/diag_msg.c
@@ -96,22 +96,30 @@ int diag_rx_ext_msg_f(struct diag_instance *di, struct msgb *msgb)
fmt = (const char *) msg->params + num_args*sizeof(msg->params[0]);
file = fmt + strlen(fmt) + 1;
- printf("MSG(%u|%u|%s:%u): ", msg->subsys_id, diag_ts_to_epoch(msg->timestamp), file, msg->line_nr);
+ printf("MSG(%u|%u|%s:%u): ", osmo_load16le(&msg->subsys_id),
+ diag_ts_to_epoch(osmo_load64le(&msg->timestamp)),
+ file, osmo_load16le(&msg->line_nr));
switch (num_args) {
case 0:
fputs(fmt, stdout);
break;
case 1:
- printf(fmt, msg->params[0]);
+ printf(fmt, osmo_load32le(&msg->params[0]));
break;
case 2:
- printf(fmt, msg->params[0], msg->params[1]);
+ printf(fmt, osmo_load32le(&msg->params[0]),
+ osmo_load32le(&msg->params[1]));
break;
case 3:
- printf(fmt, msg->params[0], msg->params[1], msg->params[2]);
+ printf(fmt, osmo_load32le(&msg->params[0]),
+ osmo_load32le(&msg->params[1]),
+ osmo_load32le(&msg->params[2]));
break;
case 4:
- printf(fmt, msg->params[0], msg->params[1], msg->params[2], msg->params[3]);
+ printf(fmt, osmo_load32le(&msg->params[0]),
+ osmo_load32le(&msg->params[1]),
+ osmo_load32le(&msg->params[2]),
+ osmo_load32le(&msg->params[3]));
break;
}
fputc('\n', stdout);