diff --git a/src/usr/local/www/services_dhcp_relay.php b/src/usr/local/www/services_dhcp_relay.php index ada2eaef0b..2ddbd6eda8 100644 --- a/src/usr/local/www/services_dhcp_relay.php +++ b/src/usr/local/www/services_dhcp_relay.php @@ -149,6 +149,8 @@ if ($_POST) { } } +$pconfig['server'] = $config['dhcrelay']['server']; + $pgtitle = array(gettext("Services"), gettext("DHCP Relay")); $shortcut_section = "dhcp"; include("head.inc"); @@ -212,7 +214,7 @@ function createDestinationServerInputGroup($value = null) { return $group; } -if (!isset($pconfig['server']) || count($pconfig['server']) < 1) { +if (!isset($pconfig['server'])) { $section->add(createDestinationServerInputGroup()); } else { foreach (explode(',', $pconfig['server']) as $server) { diff --git a/src/usr/local/www/services_dhcpv6_relay.php b/src/usr/local/www/services_dhcpv6_relay.php index 62a4f5b63f..93ca9e9348 100644 --- a/src/usr/local/www/services_dhcpv6_relay.php +++ b/src/usr/local/www/services_dhcpv6_relay.php @@ -147,6 +147,8 @@ if ($_POST) { } } +$pconfig['server'] = $config['dhcrelay6']['server']; + $pgtitle = array(gettext("Services"), gettext("DHCPv6 Relay")); $shortcut_section = "dhcp6"; include("head.inc"); @@ -211,11 +213,11 @@ function createDestinationServerInputGroup($value = null) { return $group; } -if (!isset($pconfig['server']) || count($pconfig['server']) < 1) { +if (!isset($pconfig['server'])) { $section->add(createDestinationServerInputGroup()); } else { - foreach ($pconfig['server'] as $server) { - $section->add(createDestinationServerInputGroup($server[0])); + foreach (explode(',', $pconfig['server']) as $server) { + $section->add(createDestinationServerInputGroup($server)); } }