diff options
author | sullrich <sullrich@pfsense.org> | 2009-12-02 19:04:16 -0500 |
---|---|---|
committer | sullrich <sullrich@pfsense.org> | 2009-12-02 19:04:16 -0500 |
commit | c9eca74f2b37afff309474a6b2ff24b22087bed8 (patch) | |
tree | 6593690311f3080e750547e211b34de4aba371be /usr/local/www/services_dhcp.php | |
parent | 26e3ca704c75eab3313a3d71d0175c640c1aa8fc (diff) | |
download | pfsense-c9eca74f2b37afff309474a6b2ff24b22087bed8.zip pfsense-c9eca74f2b37afff309474a6b2ff24b22087bed8.tar.gz |
Show correct availavble usable range and disallow using network or broadcast address. Ticket #145
Diffstat (limited to 'usr/local/www/services_dhcp.php')
-rwxr-xr-x | usr/local/www/services_dhcp.php | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index c2a844c..7d45643 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -228,6 +228,9 @@ if ($_POST) { if(gen_subnet_max($ifcfgip, $ifcfgsn) == $_POST['range_to']) $input_errors[] = "You cannot use the broadcast address in the ending subnet range."; + //if(is_inrange($ifcfgip, $_POST['range_from'], $_POST['range_to'])) + // $input_errors[] = "Address range includes the interface IP $ifcfgip."; + if (!$input_errors) { /* make sure the range lies within the current subnet */ $subnet_start = (ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn)); @@ -511,19 +514,25 @@ include("head.inc"); </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Subnet - mask</td> + <td width="22%" valign="top" class="vncellreq">Subnet mask</td> <td width="78%" class="vtable"> <?=gen_subnet_mask($ifcfgsn);?> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq">Available - range</td> + <td width="22%" valign="top" class="vncellreq">Available range</td> <td width="78%" class="vtable"> - <?=long2ip(ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn));?> + <?php + $range_from = ip2long(long2ip(ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn))); + $range_from++; + echo long2ip($range_from); + ?> - - <?=long2ip(ip2long($ifcfgip) | (~gen_subnet_mask_long($ifcfgsn))); ?> + <?php + $range_to = ip2long(long2ip(ip2long($ifcfgip) | (~gen_subnet_mask_long($ifcfgsn)))); + $range_to--; + echo long2ip($range_to); + ?> </td> </tr> <?php if($is_olsr_enabled): ?> |