From cdcbc11db8a4c187087ca79358d752824d72f14a Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Mon, 5 Oct 2026 21:19:59 +0200 Subject: [PATCH] shunt: fix rpcd status call * define tproxy_available() before render(): ucode resolves the name when render() is compiled, so the later definition left it null and every status call failed - LuCI showed "no answer from the backend" Signed-off-by: Dirk Brenken --- net/shunt/Makefile | 2 +- net/shunt/files/shunt.rpcd | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/net/shunt/Makefile b/net/shunt/Makefile index 5a3f4c7ea9..28b0af2807 100644 --- a/net/shunt/Makefile +++ b/net/shunt/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=shunt PKG_VERSION:=0.1.11 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:= PKG_MAINTAINER:=Dirk Brenken diff --git a/net/shunt/files/shunt.rpcd b/net/shunt/files/shunt.rpcd index b5107ee62d..50113eda44 100644 --- a/net/shunt/files/shunt.rpcd +++ b/net/shunt/files/shunt.rpcd @@ -38,6 +38,14 @@ function daemon_status() { return r ?? null; } +// Same test as the daemon's, so LuCI reports the policy the daemon skips. +function tproxy_available() { + let rel = trim(readfile('/proc/sys/kernel/osrelease') ?? ''); + + return !!(access('/sys/module/nft_tproxy') || + (length(rel) && access(`/lib/modules/${rel}/nft_tproxy.ko`))); +} + // The same sequence as the daemon's build_state(), minus the logging: two // readings of one config file are how a status view starts to lie. function render() { @@ -70,14 +78,6 @@ function render() { return { cfg, files: f, matcher: m, nft: n, route: r }; } -// Same test as the daemon's, so LuCI reports the policy the daemon skips. -function tproxy_available() { - let rel = trim(readfile('/proc/sys/kernel/osrelease') ?? ''); - - return !!(access('/sys/module/nft_tproxy') || - (length(rel) && access(`/lib/modules/${rel}/nft_tproxy.ko`))); -} - // Policy devices whose marked traffic the kernel would drop: max(all, ), // blocked only when all is strict (1) and the device is not loose itself. Same // logic as the daemon. When rp_filter_manage is on the daemon has already set