Kaynağa Gözat

Fix: Validate DHCP lease MACs too

Gogs 2 ay önce
ebeveyn
işleme
3c24986e74
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      package/src/client2server-minimal.lua

+ 2 - 1
package/src/client2server-minimal.lua

@@ -51,7 +51,8 @@ local function load_state()
             elseif t == "ssid" then ssid_enabled[v] = true
             elseif t == "dhcp" then
                 local mac, ip = v:match("^(.+)->(.+)$")
-                if mac and ip then dhcp[mac] = {ip=ip, mac=mac} end
+                -- Validate MAC for DHCP too
+                if mac and ip and is_valid_mac(mac) then dhcp[mac] = {ip=ip, mac=mac} end
             end
         end
         return { clients = clients, ssid_enabled = ssid_enabled, dhcp = dhcp }