瀏覽代碼

Fix: Validate DHCP lease MACs too

Gogs 2 月之前
父節點
當前提交
3c24986e74
共有 1 個文件被更改,包括 2 次插入1 次删除
  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 }