diff options
author | Renato Botelho <renato@netgate.com> | 2016-12-26 12:37:55 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-12-26 12:37:55 -0200 |
commit | cded235bc212d63bf7777f3f1d085d6b3b5c1121 (patch) | |
tree | d9027f606fa7de6fa7c8b7ea8fe4c0a0feba75df | |
parent | bebb4b8a128e04bfb4abe18d0e62b1b948f4afe2 (diff) | |
parent | 12e08722bd9264f649e76030dce24259430f2832 (diff) | |
download | pfsense-cded235bc212d63bf7777f3f1d085d6b3b5c1121.zip pfsense-cded235bc212d63bf7777f3f1d085d6b3b5c1121.tar.gz |
Merge pull request #3309 from phil-davis/dhcp31msg
-rw-r--r-- | src/usr/local/www/services_dhcp.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php index e8847ce..27c64a8 100644 --- a/src/usr/local/www/services_dhcp.php +++ b/src/usr/local/www/services_dhcp.php @@ -743,13 +743,19 @@ if (is_subsystem_dirty('staticmaps')) { $tab_array = array(); $tabscounter = 0; $i = 0; +$have_small_subnet = false; foreach ($iflist as $ifent => $ifname) { $oc = $config['interfaces'][$ifent]; /* Not static IPv4 or subnet >= 31 */ - if (!is_ipaddrv4($oc['ipaddr']) || - empty($oc['subnet']) || $oc['subnet'] >= 31) { + if ($oc['subnet'] >= 31) { + $have_small_subnet = true; + $example_name = $ifname; + $example_cidr = $oc['subnet']; + continue; + } + if (!is_ipaddrv4($oc['ipaddr']) || empty($oc['subnet'])) { continue; } @@ -764,7 +770,12 @@ foreach ($iflist as $ifent => $ifname) { } if ($tabscounter == 0) { - print_info_box(gettext("The DHCP Server can only be enabled on interfaces configured with a static IPv4 address. This system has none.")); + if ($have_small_subnet) { + $sentence2 = sprintf(gettext('%1$s has a CIDR mask of %2$s, which does not contain enough addresses.'), htmlspecialchars($example_name), htmlspecialchars($example_cidr)); + } else { + $sentence2 = gettext("This system has no interfaces configured with a static IPv4 address."); + } + print_info_box(gettext("The DHCP Server requires a static IPv4 subnet large enough to serve addresses to clients.") . " " . $sentence2); include("foot.inc"); exit; } |