From a10f23b79a5665f2d28445c50fc5157ed669b062 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 15 Jan 2019 17:17:34 +0100 Subject: [PATCH 1/2] Prevent multiple static DHCP entries for the same IP address to get added. Fixes #889 Signed-off-by: DL6ER --- scripts/pi-hole/php/savesettings.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/pi-hole/php/savesettings.php b/scripts/pi-hole/php/savesettings.php index a684038e..721c9430 100644 --- a/scripts/pi-hole/php/savesettings.php +++ b/scripts/pi-hole/php/savesettings.php @@ -558,6 +558,11 @@ function readAdlists() $error .= "Static release for MAC address (".htmlspecialchars($mac).") already defined!
"; break; } + if($ip !== "noip" && $lease["IP"] === $ip) + { + $error .= "Static release for IP address (".htmlspecialchars($ip).") already defined!
"; + break; + } } if(!strlen($error)) From 991be959d32c66291eb992e4c068d5001bfb84d2 Mon Sep 17 00:00:00 2001 From: Mark Drobnak Date: Sat, 19 Jan 2019 22:32:25 +0100 Subject: [PATCH 2/2] Update scripts/pi-hole/php/savesettings.php Co-Authored-By: DL6ER Signed-off-by: DL6ER --- scripts/pi-hole/php/savesettings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pi-hole/php/savesettings.php b/scripts/pi-hole/php/savesettings.php index 721c9430..9a0f5d11 100644 --- a/scripts/pi-hole/php/savesettings.php +++ b/scripts/pi-hole/php/savesettings.php @@ -560,7 +560,7 @@ function readAdlists() } if($ip !== "noip" && $lease["IP"] === $ip) { - $error .= "Static release for IP address (".htmlspecialchars($ip).") already defined!
"; + $error .= "Static lease for IP address (".htmlspecialchars($ip).") already defined!
"; break; } }