diff options
author | Zach van Rijn <me@zv.io> | 2023-06-21 10:32:28 -0700 |
---|---|---|
committer | Zach van Rijn <me@zv.io> | 2023-06-21 10:32:28 -0700 |
commit | ac09a25c3d03ff9b6932b556d1e11a2824059995 (patch) | |
tree | 57e55d3b8416d63f017b7e1b6bf154f5d09fde8f | |
parent | cd08458e24d8e1c5989bfd463293c0cde602fbee (diff) | |
download | packages-ac09a25c3d03ff9b6932b556d1e11a2824059995.tar.gz packages-ac09a25c3d03ff9b6932b556d1e11a2824059995.tar.bz2 packages-ac09a25c3d03ff9b6932b556d1e11a2824059995.tar.xz packages-ac09a25c3d03ff9b6932b556d1e11a2824059995.zip |
system/net-tools: add patch for sscanf format specifier. fixes #600.
-rw-r--r-- | system/net-tools/APKBUILD | 9 | ||||
-rw-r--r-- | system/net-tools/fix-sscanf-format-specifier.patch | 44 |
2 files changed, 50 insertions, 3 deletions
diff --git a/system/net-tools/APKBUILD b/system/net-tools/APKBUILD index 2b95aecc0..c034da22f 100644 --- a/system/net-tools/APKBUILD +++ b/system/net-tools/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Dan Theisen <djt@hxx.in> pkgname=net-tools pkgver=2.10 -pkgrel=0 +pkgrel=1 pkgdesc="Linux networking base tools" url="https://sourceforge.net/projects/net-tools/" arch="all" @@ -12,7 +12,9 @@ depends="mii-tool" depends_dev="" makedepends="$depends_dev bash linux-headers" subpackages="$pkgname-doc $pkgname-lang $pkgname-dbg mii-tool:mii_tool" -source="https://downloads.sourceforge.net/project/$pkgname/$pkgname-$pkgver.tar.xz" +source="https://downloads.sourceforge.net/project/$pkgname/$pkgname-$pkgver.tar.xz + fix-sscanf-format-specifier.patch + " prepare() { default_prepare @@ -74,4 +76,5 @@ mii_tool() { mv "$pkgdir"/sbin/mii-tool "$subpkgdir"/sbin/ } -sha512sums="aa8f631772da6c16b165065fc5929a206504f2dce19e74a4ffc680f09b40f3a9180bd4bbeaac67e0b32693358b01383bae4fbfcb6061180c130e9e0801d536bf net-tools-2.10.tar.xz" +sha512sums="aa8f631772da6c16b165065fc5929a206504f2dce19e74a4ffc680f09b40f3a9180bd4bbeaac67e0b32693358b01383bae4fbfcb6061180c130e9e0801d536bf net-tools-2.10.tar.xz +393e1faa4c6a6aa733396b28ed4fbb11f47445f34d5581c41d2a167147b8a87e67d63b59d8bdeae23a2a1587c3cad05f8eb9f5bf4339b7f2a9e780fce6044194 fix-sscanf-format-specifier.patch" diff --git a/system/net-tools/fix-sscanf-format-specifier.patch b/system/net-tools/fix-sscanf-format-specifier.patch new file mode 100644 index 000000000..e39e0434b --- /dev/null +++ b/system/net-tools/fix-sscanf-format-specifier.patch @@ -0,0 +1,44 @@ +From d7d325d5fddb0be4601a910fe23066be6c8bd603 Mon Sep 17 00:00:00 2001 +From: Zach van Rijn <me@zv.io> +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: d828f5ce7cbd8d8c5cc4cf8f4a402f9647fa8548. + +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, +-- +2.40.0 + |