projects
/
lua-squid-acl-helper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
974503f
)
Добыча MAC для IPv6 (с предварительным "прощупыванием" хоста для его попадания в...
master
author
Roman Bazalevsky
<rvb@rvb.name>
Sun, 3 Nov 2019 08:55:56 +0000
(11:55 +0300)
committer
Roman Bazalevsky
<rvb@rvb.name>
Sun, 3 Nov 2019 08:55:56 +0000
(11:55 +0300)
src/arpcache.lua
patch
|
blob
|
history
diff --git
a/src/arpcache.lua
b/src/arpcache.lua
index b4b8478ec82c118cbf37dbe2abdf340dc5b02862..329439aee6f9153058fb93d21408c428ebbf1161 100644
(file)
--- a/
src/arpcache.lua
+++ b/
src/arpcache.lua
@@
-4,6
+4,8
@@
config = require "config"
_arpcache = {}
_ARPCACHE4 = '/sbin/ip -4 n'
+_PING6 = '/bin/ping6 -c 1 -W 1'
+_ARPCACHE6 = '/sbin/ip -6 n'
function _match_v4(ip)
return string.match(ip,"%d*%.%d*%.%d*%.%d*")
@@
-22,7
+24,8
@@
function _arpcache.get_mac(ip)
if _match_v4(ip) then
cmd = _ARPCACHE4
else
- return "OK"
+ os.execute(_PING6..' '..ip)
+ cmd = _ARPCACHE6
end
local f = io.popen(cmd)