diff options
Diffstat (limited to 'libubus-io.c')
-rw-r--r-- | libubus-io.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libubus-io.c b/libubus-io.c index b9b3128..9320bf3 100644 --- a/libubus-io.c +++ b/libubus-io.c @@ -133,8 +133,8 @@ int __hidden ubus_send_msg(struct ubus_context *ctx, uint32_t seq, hdr.version = 0; hdr.type = cmd; - hdr.seq = seq; - hdr.peer = peer; + hdr.seq = cpu_to_be16(seq); + hdr.peer = cpu_to_be32(peer); if (!msg) { blob_buf_init(&b, 0); @@ -281,6 +281,9 @@ static bool get_next_msg(struct ubus_context *ctx, int *recv_fd) return false; } + hdrbuf.hdr.seq = be16_to_cpu(hdrbuf.hdr.seq); + hdrbuf.hdr.peer = be32_to_cpu(hdrbuf.hdr.peer); + if (!ubus_validate_hdr(&hdrbuf.hdr)) return false; |