projects
/
lua-squid-acl-helper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Добыча MAC для IPv6 (с предварительным "прощупыванием" хоста для его попадания в...
[lua-squid-acl-helper.git]
/
src
/
arpcache.lua
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'
_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*")
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
if _match_v4(ip) then
cmd = _ARPCACHE4
else
- return "OK"
+ os.execute(_PING6..' '..ip)
+ cmd = _ARPCACHE6
end
local f = io.popen(cmd)
end
local f = io.popen(cmd)