mirror of
https://github.com/pi-hole/web.git
synced 2026-04-22 09:48:56 +01:00
Prevent static DHCP leases from having duplicate hostnames
Fixes #979 Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
@@ -570,7 +570,7 @@ function readAdlists()
|
||||
if(strlen($ip) == 0)
|
||||
$ip = "noip";
|
||||
|
||||
// Test if this MAC address is already included
|
||||
// Test if this lease is already included
|
||||
readStaticLeasesFile();
|
||||
foreach($dhcp_static_leases as $lease) {
|
||||
if($lease["hwaddr"] === $mac)
|
||||
@@ -583,6 +583,10 @@ function readAdlists()
|
||||
$error .= "Static lease for IP address (".htmlspecialchars($ip).") already defined!<br>";
|
||||
break;
|
||||
}
|
||||
if($lease["host"] === $hostname)
|
||||
{
|
||||
$error .= "Static lease for hostname (".htmlspecialchars($hostname).") already defined!<br>";
|
||||
}
|
||||
}
|
||||
|
||||
if(!strlen($error))
|
||||
|
||||
Reference in New Issue
Block a user