diff --git a/backport-Revert-sscanf-pattern-is-Lu-not-llu-for-long-long-unsigned.patch b/backport-Revert-sscanf-pattern-is-Lu-not-llu-for-long-long-unsigned.patch new file mode 100644 index 0000000000000000000000000000000000000000..a03f8dbd554cede7033171cfa75f56005a4ab04a --- /dev/null +++ b/backport-Revert-sscanf-pattern-is-Lu-not-llu-for-long-long-unsigned.patch @@ -0,0 +1,46 @@ +From 20a78e06a69bd9b6b4e15468201d5d3aa9c395db Mon Sep 17 00:00:00 2001 +From: Zach van Rijn +Date: Wed, 21 Jun 2023 16:50:30 +0000 +Subject: [PATCH] Revert "sscanf pattern is %Lu not %llu for long long unsigned + byte counters." + +This reverts commit 811cf0aaf40a0e7f426f8ffaea7c3ca4b8bebdfc. + +See also: + * https://sourceforge.net/p/net-tools/mailman/message/37860727/ + * https://git.adelielinux.org/adelie/packages/-/issues/600 +--- + lib/interface.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/lib/interface.c b/lib/interface.c +index ef28dec..71d4163 100644 +--- a/lib/interface.c ++++ b/lib/interface.c +@@ -254,7 +254,7 @@ static int get_dev_fields(const char *bp, struct interface *ife) + switch (procnetdev_vsn) { + case 3: + sscanf(bp, +- "%Lu %Lu %lu %lu %lu %lu %lu %lu %Lu %Lu %lu %lu %lu %lu %lu %lu", ++ "%llu %llu %lu %lu %lu %lu %lu %lu %llu %llu %lu %lu %lu %lu %lu %lu", + &ife->stats.rx_bytes, + &ife->stats.rx_packets, + &ife->stats.rx_errors, +@@ -274,7 +274,7 @@ static int get_dev_fields(const char *bp, struct interface *ife) + &ife->stats.tx_compressed); + break; + case 2: +- sscanf(bp, "%Lu %Lu %lu %lu %lu %lu %Lu %Lu %lu %lu %lu %lu %lu", ++ sscanf(bp, "%llu %llu %lu %lu %lu %lu %llu %llu %lu %lu %lu %lu %lu", + &ife->stats.rx_bytes, + &ife->stats.rx_packets, + &ife->stats.rx_errors, +@@ -292,7 +292,7 @@ static int get_dev_fields(const char *bp, struct interface *ife) + ife->stats.rx_multicast = 0; + break; + case 1: +- sscanf(bp, "%Lu %lu %lu %lu %lu %Lu %lu %lu %lu %lu %lu", ++ sscanf(bp, "%llu %lu %lu %lu %lu %llu %lu %lu %lu %lu %lu", + &ife->stats.rx_packets, + &ife->stats.rx_errors, + &ife->stats.rx_dropped, diff --git a/net-tools.spec b/net-tools.spec index 789212af908a2d4a72ca629f3e6853823dabb854..daccfdaf353ed156ee1f52a640164c4e4b815228 100644 --- a/net-tools.spec +++ b/net-tools.spec @@ -1,6 +1,6 @@ Name: net-tools Version: 2.10 -Release: 3 +Release: 4 Summary: Important Programs for Networking License: GPLv2+ URL: https://sourceforge.net/projects/net-tools/ @@ -20,6 +20,7 @@ Patch2: backport-net-tools-man.patch Patch3: backport-ether-wake-interfaces.patch Patch4: backport-interface-change-pointopoint-short-flag-from-P-to-p.patch Patch5: fix-ifconfig-display-error-when-the-length-of-interface-name-is-15.patch +Patch6: backport-Revert-sscanf-pattern-is-Lu-not-llu-for-long-long-unsigned.patch BuildRequires: bluez-libs-devel gettext, libselinux libselinux-devel systemd gcc %{?systemd_requires} @@ -47,6 +48,7 @@ cp %SOURCE8 ./man/en_US %patch3 -p1 -b .interfaces %patch4 -p1 %patch5 -p1 +%patch6 -p1 touch ./config.h %build @@ -107,6 +109,12 @@ touch %{buildroot}%{_unitdir}/arp-ethers.service %exclude %{_mandir}/pt/man5 %changelog +* Tue Apr 08 2025 gaihuiying - 2.10-4 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:backport to use llu instead of Lu for unsigned long long type + * Mon Dec 19 2022 eaglegai - 2.10-3 - Type:bugfix - ID:NA