From 1e2425245a46b4acb914d32b8e7e98371845b8f4 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Wed, 8 Apr 2026 14:29:03 +0200 Subject: [PATCH] alfred: merge bugfixes from 2026.1 * Fix printing of timespec Signed-off-by: Sven Eckelmann --- alfred/Makefile | 2 +- ...0001-alfred-Fix-printing-of-timespec.patch | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 alfred/patches/0001-alfred-Fix-printing-of-timespec.patch diff --git a/alfred/Makefile b/alfred/Makefile index b2afeaf..224df48 100644 --- a/alfred/Makefile +++ b/alfred/Makefile @@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=alfred PKG_VERSION:=2025.4 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) diff --git a/alfred/patches/0001-alfred-Fix-printing-of-timespec.patch b/alfred/patches/0001-alfred-Fix-printing-of-timespec.patch new file mode 100644 index 0000000..bd4154e --- /dev/null +++ b/alfred/patches/0001-alfred-Fix-printing-of-timespec.patch @@ -0,0 +1,44 @@ +From: Sven Eckelmann +Date: Sun, 8 Mar 2026 16:07:25 +0100 +Subject: alfred: Fix printing of timespec + +musl on a 32 bit system still uses a 64-bit value (long long) for the +storage of tv_sec and tv_nsec. But the printf was evaluating these +arguments always only as long. + +During the print of the nsec value, range of 0-999_999_999 is only +possible. 30 bit is therefore enough to store this range. For simplicity, +just use an unsigned int. + +The second value on the other hand can get up to 64 bit on a 64-bit-unix +timestamp system. Just use long long for it to be on the safe side. + +Signed-off-by: Sven Eckelmann +Origin: upstream, https://git.open-mesh.org/alfred.git/commit/?id=b35a33063bf1f82fb43a689439c3f0bce631d712 + +--- a/main.c ++++ b/main.c +@@ -285,7 +285,9 @@ static struct globals *alfred_init(int a + sync_period = strtod(optarg, NULL); + globals->sync_period.tv_sec = (int)sync_period; + globals->sync_period.tv_nsec = (double)(sync_period - (int)sync_period) * 1e9; +- printf(" ** Setting sync interval to: %.9f seconds (%ld.%09ld)\n", sync_period, globals->sync_period.tv_sec, globals->sync_period.tv_nsec); ++ printf(" ** Setting sync interval to: %.9f seconds (%lld.%09u)\n", sync_period, ++ (long long)globals->sync_period.tv_sec, ++ (unsigned int)globals->sync_period.tv_nsec); + break; + case '4': + globals->ipv4mode = true; +--- a/server.c ++++ b/server.c +@@ -404,8 +404,8 @@ static void sync_period_timer(struct glo + + if (globals->opmode == OPMODE_PRIMARY) { + /* we are a primary */ +- printf("[%ld.%09ld] announce primary ...\n", +- now.tv_sec, now.tv_nsec); ++ printf("[%lld.%09u] announce primary ...\n", ++ (long long)now.tv_sec, (unsigned int)now.tv_nsec); + announce_primary(globals); + sync_data(globals); + } else {