diff options
author | Phil Davis <phil.davis@inf.org> | 2015-06-02 15:18:35 +0545 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-06-04 17:08:11 -0300 |
commit | dc6695c3f41f65dd3232e311e589bad217bb4c10 (patch) | |
tree | aad5b646ce27e9ff87aaa06d9739273e910b7526 /etc/inc | |
parent | b3bba7fe13f7f7150a9f66d16fc630716d612a83 (diff) | |
download | pfsense-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/inc')
-rw-r--r-- | etc/inc/util.inc | 8 |
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 */ |