[pve-devel] [PATCH manager] api2/metrics/server: add minimum/maximum port

Dominik Csapak d.csapak at proxmox.com
Wed Nov 25 12:06:26 CET 2020


we just added the api, so it would be good to only accept valid ports
(they were wrapped before)

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/Status/Plugin.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PVE/Status/Plugin.pm b/PVE/Status/Plugin.pm
index baf670ae..0faf0da6 100644
--- a/PVE/Status/Plugin.pm
+++ b/PVE/Status/Plugin.pm
@@ -36,6 +36,8 @@ my $defaultData = {
 	port => {
 	    type => 'integer',
 	    description => "server network port",
+	    minimum => 1,
+	    maximum => 64*1024,
 	},
 	mtu => {
 	    type => 'integer',
-- 
2.20.1






More information about the pve-devel mailing list