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_opt.php
243 243
                    <input name="ipaddr" type="text" class="formfld" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>" onchange="ipaddr_change()">
244 244
                    /
245 245
                	<select name="subnet" class="formfld" id="subnet">
246
					<?php for ($i = 32; $i > 0; $i--): ?>
247
					<option value="<?=$i;?>" <?php if ($i == $pconfig['subnet']) echo "selected"; ?>><?=$i;?></option>
248
					<?php endfor; ?>
249
                    </select>
246
					<?php
247
					for ($i = 32; $i > 0; $i--) {
248
						if($i <> 31) {
249
							echo "<option value=\"{$i}\" ";
250
							if ($i == $pconfig['subnet']) echo "selected";
251
							echo ">" . $i . "</option>";
252
						}
253
					}
254
					?>                    </select>
250 255
				 </td>
251 256
				</tr>
252 257
				<?php /* Wireless interface? */

Also available in: Unified diff