summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2016-12-13 11:24:39 +0545
committerGitHub <noreply@github.com>2016-12-13 11:24:39 +0545
commitbdda1446ca335dfcbfb3d9937a20dd2a5bf93ae9 (patch)
tree6f6a7d3b3a71fd8c5d5e9913c55a66719b8b889d /src/usr
parentc165a17e0225f09afb4882d360ba086f629f2b77 (diff)
downloadpfsense-bdda1446ca335dfcbfb3d9937a20dd2a5bf93ae9.zip
pfsense-bdda1446ca335dfcbfb3d9937a20dd2a5bf93ae9.tar.gz
DHCP4 Relay must relay to an IPv4 address
This code would accept an IPv6 address, but that causes an error to be reported by the DHCP (v4) Relay service on startup. Validate the destination server IP address(es) to ensure they are IPv4.
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/services_dhcp_relay.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/usr/local/www/services_dhcp_relay.php b/src/usr/local/www/services_dhcp_relay.php
index e57da84..e824b44 100644
--- a/src/usr/local/www/services_dhcp_relay.php
+++ b/src/usr/local/www/services_dhcp_relay.php
@@ -84,8 +84,8 @@ if ($_POST) {
if ($_POST['server']) {
foreach ($_POST['server'] as $checksrv => $srv) {
if (!empty($srv[0])) { // Filter out any empties
- if (!is_ipaddr($srv[0])) {
- $input_errors[] = sprintf(gettext("Destination Server IP address %s is not a valid IP address."), $srv[0]);
+ if (!is_ipaddrv4($srv[0])) {
+ $input_errors[] = sprintf(gettext("Destination Server IP address %s is not a valid IPv4 address."), $srv[0]);
}
if (!empty($svrlist)) {
@@ -175,9 +175,10 @@ function createDestinationServerInputGroup($value = null) {
$group->add(new Form_IpAddress(
'server',
'Destination server',
- $value
+ $value,
+ 'V4'
))->setWidth(4)
- ->setHelp('This is the IP address of the server to which DHCP requests are relayed.')
+ ->setHelp('This is the IPv4 address of the server to which DHCP requests are relayed.')
->setIsRepeated();
$group->enableDuplication(null, true); // Buttons are in-line with the input
OpenPOWER on IntegriCloud