summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-06-02 15:18:35 +0545
committerRenato Botelho <garga@FreeBSD.org>2015-06-04 17:08:11 -0300
commitdc6695c3f41f65dd3232e311e589bad217bb4c10 (patch)
treeaad5b646ce27e9ff87aaa06d9739273e910b7526 /etc
parentb3bba7fe13f7f7150a9f66d16fc630716d612a83 (diff)
downloadpfsense-dc6695c3f41f65dd3232e311e589bad217bb4c10.zip
pfsense-dc6695c3f41f65dd3232e311e589bad217bb4c10.tar.gz
Setup Wizard can result in invalid LAN DHCP pool calculation
1) consider where the LAN IP is in the subnet range and then put the DHCP pool in the biggest remaining segment, either above or below. 2) Check the size of the available segment. If it is reasonably big then leave some space at either end of the segment, like the old code was doing. Otherwise give all the space to the pool. 3) Do not allow subnet mask 32 - I can't think of a use case for LAN to have a /32 subnet mask, it kind of breaks the whole concept of LAN. 4) Provide more detailed separate messages if the user tries to use the network address or broadcast address as the LAN IP.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/util.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index f6feda1..fad6321 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -417,13 +417,13 @@ function find_smallest_cidr_v4($number) {
}
/* Return the previous IP address before the given address */
-function ip_before($ip) {
- return long2ip32(ip2long($ip)-1);
+function ip_before($ip, $offset = 1) {
+ return long2ip32(ip2long($ip) - $offset);
}
/* Return the next IP address after the given address */
-function ip_after($ip) {
- return long2ip32(ip2long($ip)+1);
+function ip_after($ip, $offset = 1) {
+ return long2ip32(ip2long($ip) + $offset);
}
/* Return true if the first IP is 'before' the second */
OpenPOWER on IntegriCloud