Don't overflow from the gigabyte scale to the bit scale if the
number to auto-scale is >= 1024 Gb. Could be triggered on arches where ifdata counters had 64 bits. Reported by: Miroslav Slavkov on -net MFC after: 3 days
This commit is contained in:
parent
e0945d6033
commit
c8d29e02f4
@ -69,7 +69,7 @@ get_tbl_ptr(const u_long size, const u_int scale)
|
||||
* index as the array index into the conversion table.
|
||||
*/
|
||||
for (tmp = size, idx = SC_KILOBYTE;
|
||||
tmp >= MEGA && idx <= SC_GIGABYTE;
|
||||
tmp >= MEGA && idx < SC_GIGABYTE;
|
||||
tmp >>= 10, idx++);
|
||||
|
||||
tbl_ptr = &convtbl[idx];
|
||||
|
Loading…
Reference in New Issue
Block a user