From 348b53dd718e64a36c4cbe085be7fa4456088ab0 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 3 Nov 2007 21:06:35 +0000 Subject: [PATCH] Do not allow dhcp-relay to be enabled if dhcp server is enabled on any interface. Ticket #1488 --- usr/local/www/services_dhcp_relay.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/usr/local/www/services_dhcp_relay.php b/usr/local/www/services_dhcp_relay.php index 326a343b42..74a114ace8 100755 --- a/usr/local/www/services_dhcp_relay.php +++ b/usr/local/www/services_dhcp_relay.php @@ -83,6 +83,13 @@ $pconfig['agentoption'] = isset($config['dhcrelay']['agentoption']); $ifcfg = $config['interfaces'][$if]; +/* set the enabled flag which will tell us if DHCP server is enabled + * on any interface. We will use this to disable dhcp-relay since + * the two are not compatible with each other. + */ +$dhcpd_enabled = false; +foreach($config['dhcpd'] as $dhcp) + if($dhcp['enable']) $dhcpd_enabled = true; if ($_POST) { @@ -170,6 +177,15 @@ function enable_change(enable_over) {
+"; + echo ""; + exit; + } +?>