From 125da846285fea5b1ebb34b32ed254b2e17204cb Mon Sep 17 00:00:00 2001 From: Roman Bazalevsky Date: Sun, 3 Nov 2019 11:55:56 +0300 Subject: [PATCH 1/1] =?utf8?q?=D0=94=D0=BE=D0=B1=D1=8B=D1=87=D0=B0=20MAC?= =?utf8?q?=20=D0=B4=D0=BB=D1=8F=20IPv6=20(=D1=81=20=D0=BF=D1=80=D0=B5?= =?utf8?q?=D0=B4=D0=B2=D0=B0=D1=80=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD?= =?utf8?q?=D1=8B=D0=BC=20"=D0=BF=D1=80=D0=BE=D1=89=D1=83=D0=BF=D1=8B=D0=B2?= =?utf8?q?=D0=B0=D0=BD=D0=B8=D0=B5=D0=BC"=20=D1=85=D0=BE=D1=81=D1=82=D0=B0?= =?utf8?q?=20=D0=B4=D0=BB=D1=8F=20=D0=B5=D0=B3=D0=BE=20=D0=BF=D0=BE=D0=BF?= =?utf8?q?=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B2=20=D1=81=D0=BF?= =?utf8?q?=D0=B8=D1=81=D0=BE=D0=BA=20=D1=81=D0=BE=D1=81=D0=B5=D0=B4=D0=B5?= =?utf8?q?=D0=B9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/arpcache.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/arpcache.lua b/src/arpcache.lua index b4b8478..329439a 100644 --- 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) -- 2.34.1