From 5bf6525050576e3abc802bcf2418c9a39f1d543c Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Thu, 6 Aug 2026 09:47:44 +0200 Subject: [PATCH 1/2] babeld: simplify LDLIBS in MAKE_FLAGS Setting LDLIBS to an empty string and appending to it on the same command line is equivalent to assigning the final value directly. No change in the resulting package. Signed-off-by: Josef Schlehofer Co-authored-by: Claude Fable 5 --- babeld/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/babeld/Makefile b/babeld/Makefile index 48604e974..0df9a2cb9 100644 --- a/babeld/Makefile +++ b/babeld/Makefile @@ -45,8 +45,7 @@ endef MAKE_FLAGS+= \ CFLAGS="$(TARGET_CFLAGS)" \ - LDLIBS="" \ - LDLIBS+="-lubus -lubox" + LDLIBS="-lubus -lubox" define Package/babeld/install $(INSTALL_DIR) $(1)/usr/sbin From e10449a115e196bab9189a54b23eb3d61a82f97e Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Thu, 6 Aug 2026 14:31:29 +0200 Subject: [PATCH 2/2] babeld: initialize metric in the ubus add_filter handler The metric is optional in filter_policy: only ifname and type are rejected when missing, so `ubus call babeld add_filter '{"ifname":"eth0","type":0}'` reaches filter->action.add_metric = metric; with metric never assigned, i.e. whatever was left on the stack. In babeld an add_metric of INFINITY means "deny", so an uninitialized read can silently turn an allow filter into a deny filter. Initialize it to 0, which is the neutral value the filter would have had if the caller had passed it explicitly. Signed-off-by: Josef Schlehofer Co-authored-by: Claude Fable 5 --- babeld/Makefile | 2 +- babeld/src/ubus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/babeld/Makefile b/babeld/Makefile index 0df9a2cb9..71ffbd11c 100644 --- a/babeld/Makefile +++ b/babeld/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=babeld PKG_VERSION:=1.13.1 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.irif.fr/~jch/software/files/ diff --git a/babeld/src/ubus.c b/babeld/src/ubus.c index a4bdf7a14..01a152c8f 100644 --- a/babeld/src/ubus.c +++ b/babeld/src/ubus.c @@ -83,7 +83,7 @@ static int babeld_ubus_add_filter(struct ubus_context *ctx_local, struct blob_buf b = {0}; struct filter *filter = NULL; char *ifname; - int metric, type; + int metric = 0, type; blobmsg_parse(filter_policy, __FILTER_MAX, tb, blob_data(msg), blob_len(msg));