From a4bb9cd515a0a205572365ca0f0586b5d33af256 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 21 Jun 2016 08:19:55 +0200 Subject: [PATCH] services: dhcpd6 is its own service; closes #1027 --- src/etc/inc/services.inc | 24 +++++++++++++++++------- src/www/services_dhcpv6.php | 4 +++- src/www/services_dhcpv6_relay.php | 10 +++++----- src/www/status_dhcpv6_leases.php | 7 ++++--- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc index c023b2819..4007188fe 100644 --- a/src/etc/inc/services.inc +++ b/src/etc/inc/services.inc @@ -412,7 +412,7 @@ function services_dhcpd_configure($family = 'all', $blacklist = array()) } } -function is_dhcp_server_enabled() +function is_dhcpv4_server_enabled() { global $config; @@ -440,7 +440,7 @@ function services_dhcpdv4_configure() killbypid("{$g['dhcpd_chroot_path']}/var/run/dhcpd.pid"); /* DHCP enabled on any interfaces? */ - if (!is_dhcp_server_enabled()) { + if (!is_dhcpv4_server_enabled()) { return 0; } @@ -2542,16 +2542,26 @@ function services_get() $services[] = $pconfig; } - if (is_dhcp_server_enabled()) { + if (is_dhcpv4_server_enabled()) { $pconfig = array(); - $pconfig['name'] = "dhcpd"; - $pconfig['description'] = gettext("DHCP Service"); - $pconfig['php']['restart'] = array('services_dhcpd_configure'); - $pconfig['php']['start'] = array('services_dhcpd_configure'); + $pconfig['name'] = 'dhcpd'; + $pconfig['description'] = gettext("DHCP Server"); + $pconfig['php']['restart'] = array('services_dhcpdv4_configure'); + $pconfig['php']['start'] = array('services_dhcpdv4_configure'); $pconfig['pidfile'] = "{$g['dhcpd_chroot_path']}/var/run/dhcpd.pid"; $services[] = $pconfig; } + if (is_dhcpv6_server_enabled()) { + $pconfig = array(); + $pconfig['name'] = 'dhcpd6'; + $pconfig['description'] = gettext("DHCPv6 Server"); + $pconfig['php']['restart'] = array('services_dhcpdv6_configure'); + $pconfig['php']['start'] = array('services_dhcpdv6_configure'); + $pconfig['pidfile'] = "{$g['dhcpd_chroot_path']}/var/run/dhcpdv6.pid"; + $services[] = $pconfig; + } + if (is_apinger_enabled()) { $pconfig = array(); $pconfig['name'] = "apinger"; diff --git a/src/www/services_dhcpv6.php b/src/www/services_dhcpv6.php index d78b15344..cc7725fe8 100644 --- a/src/www/services_dhcpv6.php +++ b/src/www/services_dhcpv6.php @@ -345,8 +345,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } -$service_hook = 'dhcpd'; +$service_hook = 'dhcpd6'; + legacy_html_escape_form_data($pconfig); + include("head.inc"); ?> diff --git a/src/www/services_dhcpv6_relay.php b/src/www/services_dhcpv6_relay.php index 5fb933ca9..9bce2cbf4 100644 --- a/src/www/services_dhcpv6_relay.php +++ b/src/www/services_dhcpv6_relay.php @@ -108,11 +108,11 @@ include("head.inc"); 0) print_input_errors($input_errors); ?>
+
- -

-
@@ -179,10 +179,10 @@ include("head.inc");
-
+
diff --git a/src/www/status_dhcpv6_leases.php b/src/www/status_dhcpv6_leases.php index 6dc6acbdd..21a35ad35 100644 --- a/src/www/status_dhcpv6_leases.php +++ b/src/www/status_dhcpv6_leases.php @@ -369,10 +369,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { exit; } -$service_hook = 'dhcpd'; -include("head.inc"); -?> +$service_hook = 'dhcpd6'; +include("head.inc"); + +?>