[openwrt/openwrt] ltq-vdsl-app: Fix counter overflow resulting in negative values

LEDE Commits lede-commits at lists.infradead.org
Fri Aug 5 05:11:17 PDT 2022


chunkeey pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/456b9029d764e69f390ee26bca24883b12eb83c2

commit 456b9029d764e69f390ee26bca24883b12eb83c2
Author: Roland Barenbrug <roland at treslong.com>
AuthorDate: Wed Jun 29 13:09:25 2022 +0200

    ltq-vdsl-app: Fix counter overflow resulting in negative values
    
    The re-transmit counters can overflow the 32 bit representation resulting
    in negative values being displayed. Background being that the numbers are
    treated at some point as signed INT rather than unsigned INT.
    Change the counters from 32 bit to 64 bit, should provide sufficient room
    to avoid any overflow. Not the nicest solution but it works
    
    Fixes: #10077
    Signed-off-by: Roland Barenbrug <roland at treslong.com>
    Acked-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
---
 package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c b/package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c
index 93eecaf71d..61ac7708ba 100644
--- a/package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c
+++ b/package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c
@@ -146,7 +146,7 @@ static inline void m_bool(const char *id, bool value) {
 }
 
 static inline void m_u32(const char *id, uint32_t value) {
-	blobmsg_add_u32(&b, id, value);
+	blobmsg_add_u64(&b, id, value);
 }
 
 static inline void m_str(const char *id, const char *value) {




More information about the lede-commits mailing list