mirror of
https://github.com/openwrt/packages.git
synced 2026-10-12 05:57:04 +04:00
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:
2 files changed
+9
-9
No files matched your search
+1
-1
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user