diff --git a/modules/luci-base/ucode/sys.uc b/modules/luci-base/ucode/sys.uc index 305499c7978..2ee2c90abcc 100644 --- a/modules/luci-base/ucode/sys.uc +++ b/modules/luci-base/ucode/sys.uc @@ -44,7 +44,12 @@ export function conntrack_list(callback) { etcpr.close(); } - const nfct = open('/proc/net/nf_conntrack', 'r'); + let nfct; + const s = stat(`/proc/net/nf_conntrack`); + if (s?.type != 'file') + nfct = popen('/usr/sbin/conntrack -L -o extended 2>/dev/null && /usr/sbin/conntrack -L -f ipv6 -o extended 2>/dev/null'); + else + nfct = open('/proc/net/nf_conntrack', 'r'); let connt; if (nfct) { diff --git a/modules/luci-mod-status/src/luci-bwc.c b/modules/luci-mod-status/src/luci-bwc.c index b7682f9e21c..d846a9a5d67 100644 --- a/modules/luci-mod-status/src/luci-bwc.c +++ b/modules/luci-mod-status/src/luci-bwc.c @@ -54,6 +54,7 @@ #define LD_SCAN_PATTERN \ "%f %f %f" +#define CONNTRACK_PATH "/usr/sbin/conntrack" struct file_map { int fd; @@ -535,7 +536,17 @@ static int run_daemon(void) closedir(dir); } - if ((info = fopen(ipc, "r")) != NULL) + if (!stat(ipc, &s)) + { + info = fopen(ipc, "r"); + } + else if (!stat(CONNTRACK_PATH, &s)) + { + info = popen(CONNTRACK_PATH" -L -o extended 2>/dev/null && " + CONNTRACK_PATH" -L -f ipv6 -o extended 2>/dev/null", "r"); + } + + if (info != NULL) { udp = 0; tcp = 0;