lede icon indicating copy to clipboard operation
lede copied to clipboard

网络接口页面数字溢出负数

Open bob-zebedy opened this issue 3 years ago • 2 comments

反馈bug/问题模板,提建议请删除

1.关于你要提交的问题

Q:是否搜索了issue (使用 "x" 选择)

  • [x] 没有类似的issue

2. 详细叙述

网络接口页面的 数据包数据太大导致溢出

20221201-Google Chrome-OpenWrt - 接口 - LuCI-005002@2x

(1) 具体问题

A:

(2) 路由器型号和固件版本

A:x86

(3) 详细日志

A:

我自己扒了下代码,貌似是因为 https://github.com/coolsnowwolf/luci/blob/master/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm#L34 中使用 %d 格式化 https://github.com/coolsnowwolf/luci/blob/master/modules/luci-base/htdocs/luci-static/resources/cbi.js#L1412 导致

不知道修改成 %s 能否解决这个问题,我试了一下,但是不知道为啥貌似没有生效。尝试删除luci的缓存无果

bob-zebedy avatar Dec 01 '22 09:12 bob-zebedy

改那个不能防止rx_packets 这个溢出

WYC-2020 avatar Dec 01 '22 10:12 WYC-2020

改那个不能防止rx_packets 这个溢出

大佬求教 这里应该怎么改。这里溢出看着真的是太难受了

bob-zebedy avatar Dec 01 '22 10:12 bob-zebedy

https://github.com/openwrt/luci/issues/3003 这里参考改下cbi.js,然后把那个%d改成%s,我看了netifd里面用的无符号,所以哪里就不用管了最多会回环,不会出现负值,但是有可能后续会变成0.,这个没仔细研究过,你先改上面两个在观察看下吧

WYC-2020 avatar Dec 05 '22 07:12 WYC-2020

openwrt/luci#3003 这里参考改下cbi.js,然后把那个%d改成%s,我看了netifd里面用的无符号,所以哪里就不用管了最多会回环,不会出现负值,但是有可能后续会变成0.,这个没仔细研究过,你先改上面两个在观察看下吧

十分感谢提供的信息,我去研究研究

bob-zebedy avatar Dec 05 '22 07:12 bob-zebedy

感觉需要达到一定数量之后换单位 不然还是会溢出(

shoucandanghehe avatar Dec 05 '22 14:12 shoucandanghehe