Project

General

Profile

« Previous | Next » 

Revision 21ab1cde

Added by Scott Ullrich over 20 years ago

remove /31 from interface IP assignment screens since a /31 subnet has 0 usable IP addresses. simpify all 1-32 loops by using the same code as much as possible.

View differences:

usr/local/www/interfaces_wan.php
461 461
                  <td class="vtable"> <input name="ipaddr" type="text" class="formfld" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
462 462
                    /
463 463
                    <select name="subnet" class="formfld" id="subnet">
464
					<?php
465
					for ($i = 32; $i > 0; $i--) {
466
						if($i <> 31) {
467
							echo "<option value=\"{$i}\" ";
468
							if ($i == $pconfig['subnet']) echo "selected";
469
							echo ">" . $i . "</option>";
470
						}
471
					}
472
					?>
464 473
                    <?php
474
					/*
465 475
                      if (isset($wancfg['ispointtopoint']))
466 476
                      	$snmax = 32;
467 477
                      else
468 478
                      	$snmax = 31;
469 479
                      for ($i = $snmax; $i > 0; $i--): ?>
470
                      <option value="<?=$i;?>" <?php if ($i == $pconfig['subnet']) echo "selected"; ?>>
480
					  <?php if(i$ <> 31) ?><option value="<?=$i;?>" <?php if ($i == $pconfig['subnet']) echo "selected"; ?>><?php end if; ?>
471 481
                      <?=$i;?>
472 482
                      </option>
473 483
                      <?php endfor; ?>
484
					*/
485
					?>
474 486
                    </select></td>
475 487
                </tr><?php if (isset($wancfg['ispointtopoint'])): ?>
476 488
                <tr>

Also available in: Unified diff