소스 검색

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 }