[OpenWrt-Devel] [PATCH 2/2 ubus] libubus: Fix reverse order processing of pending ubus notifications messages

Hans Dedecker dedeckeh at gmail.com
Mon Nov 2 05:16:11 EST 2015


Append ubus notification messages to the tail of the pending list
so they're processed in the order as they're put onto the pending list

Signed-off-by: Xinxing Hu <xinxing.huchn at gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 libubus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libubus.c b/libubus.c
index ccaa069..e1e68d0 100644
--- a/libubus.c
+++ b/libubus.c
@@ -81,7 +81,7 @@ ubus_queue_msg(struct ubus_context *ctx, struct ubus_msghdr_buf *buf)
 	pending->hdr.data = data;
 	memcpy(&pending->hdr.hdr, &buf->hdr, sizeof(buf->hdr));
 	memcpy(data, buf->data, blob_raw_len(buf->data));
-	list_add(&pending->list, &ctx->pending);
+	list_add_tail(&pending->list, &ctx->pending);
 	if (ctx->sock.registered)
 		uloop_timeout_set(&ctx->pending_timer, 1);
 }
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list