[pve-devel] [PATCH common 1/4] Consider /31 and /32 valid subnet masks.

Wolfgang Bumiller w.bumiller at proxmox.com
Fri Jun 3 11:09:21 CEST 2016


Since we already allow this for container IP addresses it is
reasonable to assume the host might be using such a setup as
well. (You can use an additional route to reach the gateway
and then simply have no "LAN".) Some people seem to want
this...
---
 src/PVE/JSONSchema.pm | 4 +++-
 src/PVE/Network.pm    | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm
index a2394f7..5b5fe15 100644
--- a/src/PVE/JSONSchema.pm
+++ b/src/PVE/JSONSchema.pm
@@ -229,7 +229,9 @@ my $ipv4_mask_hash = {
     '255.255.255.224' => 27,
     '255.255.255.240' => 28,
     '255.255.255.248' => 29,
-    '255.255.255.252' => 30
+    '255.255.255.252' => 30,
+    '255.255.255.254' => 31,
+    '255.255.255.255' => 32,
 };
 
 register_format('ipv4mask', \&pve_verify_ipv4mask);
diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm
index 71af2b8..ab07350 100644
--- a/src/PVE/Network.pm
+++ b/src/PVE/Network.pm
@@ -71,6 +71,8 @@ our $ipv4_mask_hash_localnet = {
     '255.255.255.240' => 28,
     '255.255.255.248' => 29,
     '255.255.255.252' => 30,
+    '255.255.255.254' => 31,
+    '255.255.255.255' => 32,
 };
 
 sub setup_tc_rate_limit {
-- 
2.1.4




More information about the pve-devel mailing list