diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-08-23 10:36:26 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-08-23 10:36:26 +0000 |
commit | cdf81ba227d2c07fd0434a777a756cedafef8dd5 (patch) | |
tree | 6d8c054038bbb0f22538a4733d31a94569335bfd /openssh-model.lua | |
parent | 35575c00e7c4e9b37f7208e568cfd9e6193bb931 (diff) | |
download | acf-openssh-cdf81ba227d2c07fd0434a777a756cedafef8dd5.tar.bz2 acf-openssh-cdf81ba227d2c07fd0434a777a756cedafef8dd5.tar.xz |
Bugfix on resolving hostname for connected peers
git-svn-id: svn://svn.alpinelinux.org/acf/openssh/trunk@1406 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'openssh-model.lua')
-rw-r--r-- | openssh-model.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/openssh-model.lua b/openssh-model.lua index de1c4b5..1cc5598 100644 --- a/openssh-model.lua +++ b/openssh-model.lua @@ -169,7 +169,8 @@ function list_conn_peers() config = read_config() local f = io.popen( path .. 'netstat -lna | grep ' .. tostring(config.Port) .. ' | grep "ESTABLISHED"' ) for line in f:lines() do - local peer = string.match(line, "^.-:.-:.-:.-:.-:.-:.-:(.-):.-$") + local peer = string.match(line, "^%S*%s*%S*%s*%S*%s*%S*%s*(%S*)") + peer = string.match(peer, "^.*:(%S-):%d*$") if (peer) then if not (netstat[peer]) then netstat[peer] = {cnt=0} end netstat[peer]['cnt'] = (tonumber(netstat[peer]['cnt']) + 1) |