Skip to content

Commit

Permalink
Merge pull request pi-hole#868 from pi-hole/new/rfc4039
Browse files Browse the repository at this point in the history
Add support for DHCPv4 rapid commit
  • Loading branch information
DL6ER authored Nov 27, 2018
2 parents 738cf04 + 18f9ed4 commit c4b9018
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scripts/pi-hole/php/savesettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,18 @@ function readAdlists()
$type = "(IPv4)";
}

if(isset($_POST["DHCP_rapid_commit"]))
{
$rapidcommit = "true";
}
else
{
$rapidcommit = "false";
}

if(!strlen($error))
{
exec("sudo pihole -a enabledhcp ".$from." ".$to." ".$router." ".$leasetime." ".$domain." ".$ipv6);
exec("sudo pihole -a enabledhcp ".$from." ".$to." ".$router." ".$leasetime." ".$domain." ".$ipv6." ".$rapidcommit);
$success .= "The DHCP server has been activated ".htmlspecialchars($type);
}
}
Expand Down
14 changes: 14 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@
} else {
$DHCPIPv6 = false;
}
if (isset($setupVars["DHCP_rapid_commit"])) {
$DHCP_rapid_commit = $setupVars["DHCP_rapid_commit"];
} else {
$DHCP_rapid_commit = false;
}

} else {
$DHCP = false;
Expand All @@ -356,6 +361,7 @@
}
$DHCPleasetime = 24;
$DHCPIPv6 = false;
$DHCP_rapid_commit = false;
}
if (isset($setupVars["PIHOLE_DOMAIN"])) {
$piHoleDomain = $setupVars["PIHOLE_DOMAIN"];
Expand Down Expand Up @@ -475,6 +481,14 @@
?>>Enable IPv6 support (SLAAC + RA)</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label><input type="checkbox" name="DHCP_rapid_commit" class="DHCPgroup"
<?php if ($DHCP_rapid_commit){ ?>checked<?php };
if (!$DHCP){ ?> disabled<?php }
?>>Enable DHCP rapid commit (fast address assignment)</label>
</div>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit c4b9018

Please sign in to comment.