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 <dev@brenken.org>
This commit is contained in:
Dirk Brenken committed 2026-10-05 21:19:59 +02:00
1 parent fa45216764
commit cdcbc11db8
2 files changed
+9 -9

No files matched your search

+1 -1
View File
@@ -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 <dev@brenken.org>
+8 -8
View File
@@ -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, <dev>),
// 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