mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 00:34:44 +02:00
Fix PORT_FLOOR
check and CIDR_MAX_BITS
in AssignmentService (#491)
* fix max cidr * fix port floor
This commit is contained in:
parent
8a3d67ada0
commit
a04937d698
@ -14,7 +14,7 @@ use App\Exceptions\Service\Allocation\TooManyPortsInRangeException;
|
||||
|
||||
class AssignmentService
|
||||
{
|
||||
public const CIDR_MAX_BITS = 27;
|
||||
public const CIDR_MAX_BITS = 25;
|
||||
public const CIDR_MIN_BITS = 32;
|
||||
public const PORT_FLOOR = 1024;
|
||||
public const PORT_CEIL = 65535;
|
||||
@ -74,7 +74,7 @@ class AssignmentService
|
||||
throw new TooManyPortsInRangeException();
|
||||
}
|
||||
|
||||
if ((int) $matches[1] <= self::PORT_FLOOR || (int) $matches[2] > self::PORT_CEIL) {
|
||||
if ((int) $matches[1] < self::PORT_FLOOR || (int) $matches[2] > self::PORT_CEIL) {
|
||||
throw new PortOutOfRangeException();
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ class AssignmentService
|
||||
];
|
||||
}
|
||||
} else {
|
||||
if ((int) $port <= self::PORT_FLOOR || (int) $port > self::PORT_CEIL) {
|
||||
if ((int) $port < self::PORT_FLOOR || (int) $port > self::PORT_CEIL) {
|
||||
throw new PortOutOfRangeException();
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ return [
|
||||
'too_many_ports' => 'Adding more than 1000 ports in a single range at once is not supported.',
|
||||
'invalid_mapping' => 'The mapping provided for :port was invalid and could not be processed.',
|
||||
'cidr_out_of_range' => 'CIDR notation only allows masks between /25 and /32.',
|
||||
'port_out_of_range' => 'Ports in an allocation must be greater than 1024 and less than or equal to 65535.',
|
||||
'port_out_of_range' => 'Ports in an allocation must be greater than or equal to 1024 and less than or equal to 65535.',
|
||||
],
|
||||
'egg' => [
|
||||
'delete_has_servers' => 'An Egg with active servers attached to it cannot be deleted from the Panel.',
|
||||
|
Loading…
x
Reference in New Issue
Block a user