]> git.proxmox.com Git - pve-network.git/blobdiff - PVE/Network/SDN/Zones/QinQPlugin.pm
vnet: make tag optional and verify value in zone plugins
[pve-network.git] / PVE / Network / SDN / Zones / QinQPlugin.pm
index c8dd0ab145d397c7672a919cfcd57093e0d207be..b39732ac835bb93f5232ae0cb188f429a225e6af 100644 (file)
@@ -3,6 +3,7 @@ package PVE::Network::SDN::Zones::QinQPlugin;
 use strict;
 use warnings;
 use PVE::Network::SDN::Zones::Plugin;
+use PVE::Exception qw(raise raise_param_exc);
 
 use base('PVE::Network::SDN::Zones::Plugin');
 
@@ -210,6 +211,13 @@ sub status {
     return $err_msg;
 }
 
+sub verify_tag {
+    my ($class, $tag) = @_;
+
+    raise_param_exc({ tag => "missing vlan tag"}) if !defined($tag);
+    raise_param_exc({ tag => "vlan tag max value is 4096"}) if $tag > 4096;
+}
+
 1;