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:
6ee5c59
)
luci-base: luci.sys: canonicalize src and dest addrs in luci.sys.net.conntrack()
author
Jo-Philipp Wich
<
[email protected]
>
Sat, 20 Feb 2016 21:14:37 +0000
(22:14 +0100)
committer
Jo-Philipp Wich
<
[email protected]
>
Sat, 20 Feb 2016 21:14:47 +0000
(22:14 +0100)
Signed-off-by: Jo-Philipp Wich <
[email protected]
>
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 fb2c4b1f8932784ece196e12a0349a264f9a9625..a97271732ad0f2d0d72db2b4695963dc391e9e3f 100644
(file)
--- a/
modules/luci-base/luasrc/sys.lua
+++ b/
modules/luci-base/luasrc/sys.lua
@@
-343,7
+343,11
@@
function net.conntrack(callback)
for key, val in tuples:gmatch("(%w+)=(%S+)") do
if key == "bytes" or key == "packets" then
entry[key] = entry[key] + tonumber(val, 10)
- elseif key == "src" or key == "dst" or key == "sport" or key == "dport" then
+ elseif key == "src" or key == "dst" then
+ if entry[key] == nil then
+ entry[key] = luci.ip.new(val):string()
+ end
+ elseif key == "sport" or key == "dport" then
if entry[key] == nil then
entry[key] = val
end