luci-base: sys.uc: reliably skip TIME_WAIT connections in conntrack list
authorJo-Philipp Wich <jo@mein.io>
Tue, 27 Sep 2022 20:33:04 +0000 (22:33 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 24 Oct 2022 23:03:37 +0000 (01:03 +0200)
The TIME_WAIT indicator might not appear at the beginning of the tuple
string in some cases, so match it anywhere.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
[add commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/ucode/sys.uc

index 33a7ac7d76b42e8ffc7bd27ab8fc5846f394e9bc..305499c7978342613d876b67eb573c9fa0b75862 100644 (file)
@@ -67,7 +67,7 @@ export function conntrack_list(callback) {
                                tuples = m[2];
                        }
 
-                       if (index(tuples, 'TIME_WAIT ') === 0)
+                       if (index(tuples, 'TIME_WAIT') !== -1)
                                continue;
 
                        let e = {