Use the correct parameters for list_add_tail when enqueueing a message
in the tx_queue. Previously, list_add_tail(list, entry) was used instead
of list_add_tail(entry, list). Due to this, the list would only contain
the latest entry, and previously inserted entries were left dangling.
Reset the tx_queue offset after a message from the tx_queue has been sent
completely.
Signed-off-by: Alexander Van Parys <alexander.vanparys_ext@softathome.com>
INIT_LIST_HEAD(&ubl->list);
ubl->msg = ubus_msg_ref(ub);
- list_add_tail(&cl->tx_queue, &ubl->list);
+ list_add_tail(&ubl->list, &cl->tx_queue);
cl->txq_len += ub->len;
}
if (cl->txq_ofs < ub->len + sizeof(ub->hdr))
break;
+ cl->txq_ofs = 0;
ubus_msg_list_free(ubl);
}