diff options
| author | Thomas Weißschuh | 2023-05-28 07:02:51 +0000 |
|---|---|---|
| committer | Hauke Mehrtens | 2023-06-25 20:03:39 +0000 |
| commit | c07ab2f91061ad64209e9aaa1fb1b77061a1af25 (patch) | |
| tree | 8eae7cd070070057c00e06b854906a2e92c0f4a7 | |
| parent | 31c390727b83c9efd768c7aa258813e6084b46a3 (diff) | |
| download | rpcd-c07ab2f91061ad64209e9aaa1fb1b77061a1af25.tar.gz | |
iwinfo: update byte counter to 64bit
This prevents overflows after 4GiB or 2GiB if the number is interpreted
as signed integer, for example in the blobmbsg json serialization.
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
| -rw-r--r-- | iwinfo.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -535,7 +535,7 @@ rpc_iwinfo_assoclist(struct ubus_context *ctx, struct ubus_object *obj, e = blobmsg_open_table(&buf, "rx"); blobmsg_add_u64(&buf, "drop_misc", a->rx_drop_misc); blobmsg_add_u32(&buf, "packets", a->rx_packets); - blobmsg_add_u32(&buf, "bytes", a->rx_bytes); + blobmsg_add_u64(&buf, "bytes", a->rx_bytes); rpc_iwinfo_add_rateinfo(&a->rx_rate); blobmsg_close_table(&buf, e); @@ -543,7 +543,7 @@ rpc_iwinfo_assoclist(struct ubus_context *ctx, struct ubus_object *obj, blobmsg_add_u32(&buf, "failed", a->tx_failed); blobmsg_add_u32(&buf, "retries", a->tx_retries); blobmsg_add_u32(&buf, "packets", a->tx_packets); - blobmsg_add_u32(&buf, "bytes", a->tx_bytes); + blobmsg_add_u64(&buf, "bytes", a->tx_bytes); rpc_iwinfo_add_rateinfo(&a->tx_rate); blobmsg_close_table(&buf, e); |