diff --git a/usr/local/www/diag_dhcp_leases.php b/usr/local/www/diag_dhcp_leases.php index 777da4a410..a05447e26c 100755 --- a/usr/local/www/diag_dhcp_leases.php +++ b/usr/local/www/diag_dhcp_leases.php @@ -66,7 +66,7 @@ if (($_GET['deleteip']) && (is_ipaddr($_GET['deleteip']))) { /* Restart DHCP Service */ services_dhcpd_configure(); - header("Location: diag_dhcp_leases.php"); + header("Location: diag_dhcp_leases.php?all={$_GET['all']}"); } include("head.inc"); @@ -364,7 +364,7 @@ foreach ($leases as $data) { /* Only show the button for offline dynamic leases */ if (($data['type'] == "dynamic") && ($data['online'] != "online")) { - echo ""; + echo ""; echo "\n"; } echo "\n"; diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index b5b75bd45f..96dd735ca6 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -38,6 +38,8 @@ require("guiconfig.inc"); function dhcp_clean_leases() { global $g, $config; $leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases"; + if (!file_exists($leasesfile)) + return; /* Build list of static MACs */ $staticmacs = array(); foreach($config['interfaces'] as $ifname => $ifarr)