Добавлено кеширование привязки IP-mac.
[lua-squid-acl-helper.git] / src / connection.lua
index e1eff467dbfa22249e02d0c10fdaad76220a792e..f40dead190770d13fa0b7cd8f4b2af06e6f7baf3 100644 (file)
@@ -7,14 +7,15 @@ arpcache = require "arpcache"
 function _connection.auth(serv, localport, remoteport)
 
   local user = config.map_ip(serv)
+  local mac = nil
   
   if not user then
-    local mac = arpcache.get_mac(serv)
+    mac = arpcache.get_mac(serv)
     if mac then
       user = config.map_mac(mac)
     end  
   end
-    
+
   if user == "*ident" then
     user = ident.resolve(serv,localport,config.map_port(remoteport))
   end