Эх сурвалжийг харах

Fix: Validate DHCP lease MACs too

Gogs 2 сар өмнө
parent
commit
3c24986e74

+ 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 }