net-tools/net-tools-ifconfig-EiB.patch
Petr Šabata 33b01e4951 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/net-tools#2125c98c113bfd58426f510595f51980ae9e3a08
2020-10-15 20:58:47 +02:00

35 lines
1.1 KiB
Diff

diff --git a/lib/interface.c.old b/lib/interface.c
index c734c83..9c49a03 100644
--- a/lib/interface.c.old
+++ b/lib/interface.c
@@ -928,10 +928,10 @@ void ife_print_long(struct interface *ptr)
*/
rx = ptr->stats.rx_bytes;
short_rx = rx * 10;
- if (rx > 1125899906842624ull) {
- if (rx > (9223372036854775807ull / 10))
- short_rx = rx / 112589990684262ull;
- else
+ if (rx > 1152921504606846976ull) {
+ short_rx = rx / 115292150460684697ull;
+ Rext = "EiB";
+ } else if (rx > 1125899906842624ull) {
short_rx /= 1125899906842624ull;
Rext = "PiB";
} else if (rx > 1099511627776ull) {
@@ -949,10 +949,10 @@ void ife_print_long(struct interface *ptr)
}
tx = ptr->stats.tx_bytes;
short_tx = tx * 10;
- if (tx > 1125899906842624ull) {
- if (tx > (9223372036854775807ull / 10))
- short_tx = tx / 112589990684262ull;
- else
+ if (tx > 1152921504606846976ull) {
+ short_tx = tx / 115292150460684697ull;
+ Text = "EiB";
+ } else if (tx > 1125899906842624ull) {
short_tx /= 1125899906842624ull;
Text = "PiB";
} else if (tx > 1099511627776ull) {