summaryrefslogtreecommitdiffstats
path: root/src/etc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2017-04-04 08:34:30 -0400
committerjim-p <jimp@pfsense.org>2017-04-04 08:34:30 -0400
commit24c7680a5a784ade23098d250711c6c7e7e81d2d (patch)
treed1e987cb0e4438d9c98e6b300dcd98597ec58bcd /src/etc
parent7d039bc6138910a90da3c070d21cf93c7c4fbace (diff)
parente250fcab5c085db34e2d51fe4bd602ad7bc22b9e (diff)
downloadpfsense-24c7680a5a784ade23098d250711c6c7e7e81d2d.zip
pfsense-24c7680a5a784ade23098d250711c6c7e7e81d2d.tar.gz
Merge pull request #3683 from luckman212/dhcprejectfrom-patch-1
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/inc/interfaces.inc23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc
index 40e5c27..d50aab8 100644
--- a/src/etc/inc/interfaces.inc
+++ b/src/etc/inc/interfaces.inc
@@ -38,6 +38,27 @@ function interfaces_bring_up($interface) {
}
/*
+ * Validate comma-separated list of IPv4 addresses
+ */
+function validate_ipv4_list($value) {
+ $value = trim($value);
+
+ if (empty($value)) {
+ return false;
+ }
+
+ $list = explode(',', $value);
+
+ foreach ($list as $ip) {
+ if (!is_ipaddrv4($ip)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/*
* Return the interface array
*/
function get_interface_arr($flush = false) {
@@ -4509,7 +4530,7 @@ initial-interval 1;
script "/usr/local/sbin/pfSense-dhclient-script";
EOD;
- if (is_ipaddrv4($wancfg['dhcprejectfrom'])) {
+ if (validate_ipv4_list($wancfg['dhcprejectfrom'])) {
$dhclientconf .= <<<EOD
reject {$wancfg['dhcprejectfrom']};
OpenPOWER on IntegriCloud