projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0473e99
)
luci-base: sys.lua: fix parsing conntrack entries without timeout
author
Jo-Philipp Wich
<
[email protected]
>
Fri, 29 Apr 2022 10:16:19 +0000
(12:16 +0200)
committer
Jo-Philipp Wich
<
[email protected]
>
Fri, 29 Apr 2022 10:18:46 +0000
(12:18 +0200)
Flow offloaded conntrack entries carry no timeout value and trip up the
record parsing routine. Adjust the code to properly deal with such entries.
Ref: https://forum.openwrt.org/t/offloading-breaks-connections-list/126423
Signed-off-by: Jo-Philipp Wich <
[email protected]
>
(cherry picked from commit
531c0ecff2ca57c4bc0aacee66a0746814fefc78
)
modules/luci-base/luasrc/sys.lua
patch
|
blob
|
history
diff --git
a/modules/luci-base/luasrc/sys.lua
b/modules/luci-base/luasrc/sys.lua
index af345a16d57291a0daffca53a58707180f3dfb9a..71db04acf84255b13b97bbe431d23d0302729734 100644
(file)
--- a/
modules/luci-base/luasrc/sys.lua
+++ b/
modules/luci-base/luasrc/sys.lua
@@
-286,8
+286,14
@@
function net.conntrack(callback)
local line, connt = nil, (not callback) and { }
for line in nfct do
- local fam, l3, l4, timeout, tuples =
- line:match("^(ipv[46]) +(%d+) +%S+ +(%d+) +(%d+) +(.+)$")
+ local fam, l3, l4, rest =
+ line:match("^(ipv[46]) +(%d+) +%S+ +(%d+) +(.+)$")
+
+ local timeout, tuples = rest:match("^(%d+) +(.+)$")
+
+ if not tuples then
+ tuples = rest
+ end
if fam and l3 and l4 and timeout and not tuples:match("^TIME_WAIT ") then
l4 = nixio.getprotobynumber(l4)