Merge pull request #278 from pi-hole/Mcat12-fix-noIPv4-DHCP

Handle no IPv4 address when guessing initial DHCP
This commit is contained in:
DL6ER
2016-12-22 00:28:57 +01:00
committed by GitHub
+11 -4
View File
@@ -106,10 +106,17 @@
{
$DHCP = false;
// Try to guess initial settings
$DHCPdomain = explode(".",$piHoleIPv4);
$DHCPstart = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".201";
$DHCPend = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".251";
$DHCProuter = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".1";
if($piHoleIPv4 !== "unknown") {
$DHCPdomain = explode(".",$piHoleIPv4);
$DHCPstart = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".201";
$DHCPend = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".251";
$DHCProuter = $DHCPdomain[0].".".$DHCPdomain[1].".".$DHCPdomain[2].".1";
}
else {
$DHCPstart = "";
$DHCPend = "";
$DHCProuter = "";
}
}
if(isset($setupVars["PIHOLE_DOMAIN"])){
$piHoleDomain = $setupVars["PIHOLE_DOMAIN"];