Skip to content

Commit

Permalink
shell: fix IPv4 /31 assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Jul 13, 2021
1 parent 11b5fe6 commit b1241ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/opnsense/scripts/shell/setaddr.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,10 @@ function console_configure_ip_address($version)
$maxbits
) . "\n> ";
$intbits = chop(fgets($fp));
$intbits_ok = is_numeric($intbits) && (($intbits >= 1) && ($intbits <= $maxbits));
$intbits_ok = is_numeric($intbits) && $intbits >= 1 && $intbits <= $maxbits;
$restart_dhcpd = true;

if ($version === 4 && $intbits < $maxbits) {
if ($version === 4 && $intbits < 31) {
if ($intip == gen_subnet($intip, $intbits)) {
echo 'You cannot set network address to an interface';
continue 2;
Expand Down

0 comments on commit b1241ae

Please sign in to comment.