luci-base: sys.uc: fix parsing conntrack list
Ensure that the extracted tuple string starts with a space to fully match all contained key-value pairs. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
60a9f01978
commit
791a71d225
1 changed files with 2 additions and 2 deletions
|
@ -49,7 +49,7 @@ export function conntrack_list(callback) {
|
||||||
|
|
||||||
if (nfct) {
|
if (nfct) {
|
||||||
for (let line = nfct.read('line'); length(line); line = nfct.read('line')) {
|
for (let line = nfct.read('line'); length(line); line = nfct.read('line')) {
|
||||||
let m = match(line, /^(ipv[46]) +([0-9]+) +\S+ +([0-9]+) +(.+)\n$/);
|
let m = match(line, /^(ipv[46]) +([0-9]+) +\S+ +([0-9]+)( +.+)\n$/);
|
||||||
|
|
||||||
if (!m)
|
if (!m)
|
||||||
continue;
|
continue;
|
||||||
|
@ -60,7 +60,7 @@ export function conntrack_list(callback) {
|
||||||
let tuples = m[4];
|
let tuples = m[4];
|
||||||
let timeout = null;
|
let timeout = null;
|
||||||
|
|
||||||
m = match(tuples, /^([0-9]+) (.+)$/);
|
m = match(tuples, /^ +([0-9]+)( .+)$/);
|
||||||
|
|
||||||
if (m) {
|
if (m) {
|
||||||
timeout = m[1];
|
timeout = m[1];
|
||||||
|
|
Loading…
Reference in a new issue