diff options
author | lukehamburg <luke.hamburg@gmail.com> | 2017-03-29 09:00:27 -0400 |
---|---|---|
committer | lukehamburg <luke.hamburg@gmail.com> | 2017-03-29 09:00:27 -0400 |
commit | 392a70458e9bdca9f22b2d432ecf966b7f4b7f7f (patch) | |
tree | d53234cc39571beff54d4707fdd74794e5104770 /src/etc | |
parent | fe255e99389cb6f75a06c55797890c52bd934f0f (diff) | |
download | pfsense-392a70458e9bdca9f22b2d432ecf966b7f4b7f7f.zip pfsense-392a70458e9bdca9f22b2d432ecf966b7f4b7f7f.tar.gz |
Adds ability to ignore DHCP offers from multiple servers
- Forum thread: https://forum.pfsense.org/index.php?topic=124046.msg705100#msg705100
- related dhclient source:
https://github.com/pfsense/FreeBSD-src/blob/devel/sbin/dhclient/clparse.c#L945
**changed files:**
/usr/local/www/interfaces.php
/etc/inc/interfaces.inc
Diffstat (limited to 'src/etc')
-rw-r--r-- | src/etc/inc/interfaces.inc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 40e5c27..e746e83 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) { |