diff options
| author | Felix Fietkau | 2025-07-02 17:05:08 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2025-07-02 17:06:06 +0000 |
| commit | 5952b48e251c0ea76dfce97f129da6f18d889eda (patch) | |
| tree | b733e3faf7ed86400bca2b135ebe7efbbcbf2ca1 | |
| parent | b1b783c7474269593b23ba01be8a86eb36e3471a (diff) | |
| download | ubus-5952b48e251c0ea76dfce97f129da6f18d889eda.tar.gz | |
ubusd: do not call socket callback from ubus_msg_send
Fixes a crash.
Fixes: 713e9d19b2b6 ("ubusd: retry write on EINTR")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
| -rw-r--r-- | ubusd.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -161,13 +161,12 @@ static void ubus_msg_enqueue(struct ubus_client *cl, struct ubus_msg_buf *ub) /* takes the msgbuf reference */ void ubus_msg_send(struct ubus_client *cl, struct ubus_msg_buf *ub) { - bool write_direct = list_empty(&cl->tx_queue); ssize_t written; if (ub->hdr.type != UBUS_MSG_MONITOR) ubusd_monitor_message(cl, ub, true); - if (write_direct) { + if (list_empty(&cl->tx_queue)) { written = ubus_msg_writev(cl->sock.fd, ub, 0); if (written < 0) @@ -184,7 +183,4 @@ void ubus_msg_send(struct ubus_client *cl, struct ubus_msg_buf *ub) } ubus_msg_enqueue(cl, ub); - - if (write_direct) - cl->sock.cb(&cl->sock, ULOOP_WRITE); } |