[pve-devel] [PATCH v2 pve-network 07/15] remove vxlan|vlan allowed zone option
Alexandre Derumier
aderumier at odiso.com
Tue Nov 26 10:00:22 CET 2019
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/Network/SDN/Zones/EvpnPlugin.pm | 25 -----------------------
PVE/Network/SDN/Zones/FaucetPlugin.pm | 1 -
PVE/Network/SDN/Zones/QinQPlugin.pm | 2 --
PVE/Network/SDN/Zones/VlanPlugin.pm | 27 -------------------------
PVE/Network/SDN/Zones/VxlanPlugin.pm | 29 ---------------------------
5 files changed, 84 deletions(-)
diff --git a/PVE/Network/SDN/Zones/EvpnPlugin.pm b/PVE/Network/SDN/Zones/EvpnPlugin.pm
index d294bc3..2acb9ae 100644
--- a/PVE/Network/SDN/Zones/EvpnPlugin.pm
+++ b/PVE/Network/SDN/Zones/EvpnPlugin.pm
@@ -39,7 +39,6 @@ sub options {
return {
'uplink-id' => { optional => 0 },
- 'vxlan-allowed' => { optional => 1 },
'vrf' => { optional => 0 },
'vrf-vxlan' => { optional => 0 },
'controller' => { optional => 0 },
@@ -57,7 +56,6 @@ sub generate_sdn_config {
my $mac = $vnet->{mac};
my $uplink = $plugin_config->{'uplink-id'};
- my $vxlanallowed = $plugin_config->{'vxlan-allowed'};
my $vrf = $plugin_config->{'vrf'};
my $vrfvxlan = $plugin_config->{'vrf-vxlan'};
@@ -136,29 +134,6 @@ sub generate_sdn_config {
sub on_update_hook {
my ($class, $transportid, $sdn_cfg) = @_;
- my $transport = $sdn_cfg->{ids}->{$transportid};
-
- # verify that vxlan-allowed don't conflict with another vxlan-allowed transport
-
- # verify that vxlan-allowed is matching currently vnet tag in this transport
- my $vxlanallowed = $transport->{'vxlan-allowed'};
- if ($vxlanallowed) {
- foreach my $id (keys %{$sdn_cfg->{ids}}) {
- my $sdn = $sdn_cfg->{ids}->{$id};
- if ($sdn->{type} eq 'vnet' && defined($sdn->{tag})) {
- if(defined($sdn->{zone}) && $sdn->{zone} eq $transportid) {
- my $tag = $sdn->{tag};
- eval {
- PVE::Network::SDN::Zones::Plugin::parse_tag_number_or_range($vxlanallowed, '16777216', $tag);
- };
- if($@) {
- die "vnet $id - vlan $tag is not allowed in transport $transportid";
- }
- }
- }
- }
- }
-
# verify that router exist
if (defined($sdn_cfg->{ids}->{$transportid}->{router})) {
my $router = $sdn_cfg->{ids}->{$transportid}->{router};
diff --git a/PVE/Network/SDN/Zones/FaucetPlugin.pm b/PVE/Network/SDN/Zones/FaucetPlugin.pm
index e914d4d..e9c07a6 100644
--- a/PVE/Network/SDN/Zones/FaucetPlugin.pm
+++ b/PVE/Network/SDN/Zones/FaucetPlugin.pm
@@ -31,7 +31,6 @@ sub options {
'dp-id' => { optional => 0 },
'uplink-id' => { optional => 0 },
'controller' => { optional => 0 },
- 'vlan-allowed' => { optional => 1 },
};
}
diff --git a/PVE/Network/SDN/Zones/QinQPlugin.pm b/PVE/Network/SDN/Zones/QinQPlugin.pm
index d90382c..734c56b 100644
--- a/PVE/Network/SDN/Zones/QinQPlugin.pm
+++ b/PVE/Network/SDN/Zones/QinQPlugin.pm
@@ -31,7 +31,6 @@ sub options {
return {
'uplink-id' => { optional => 0 },
'tag' => { optional => 0 },
- 'vlan-allowed' => { optional => 1 },
'vlan-protocol' => { optional => 1 },
};
}
@@ -46,7 +45,6 @@ sub generate_sdn_config {
my $alias = $vnet->{alias};
my $vlanprotocol = $plugin_config->{'vlan-protocol'};
my $uplink = $plugin_config->{'uplink-id'};
- my $vlanallowed = $plugin_config->{'vlan-allowed'};
die "missing vlan tag" if !$tag;
die "missing transport vlan tag" if !$transport_tag;
diff --git a/PVE/Network/SDN/Zones/VlanPlugin.pm b/PVE/Network/SDN/Zones/VlanPlugin.pm
index dd03838..07188f6 100644
--- a/PVE/Network/SDN/Zones/VlanPlugin.pm
+++ b/PVE/Network/SDN/Zones/VlanPlugin.pm
@@ -26,10 +26,6 @@ sub properties {
minimum => 1, maximum => 4096,
description => 'Uplink interface',
},
- 'vlan-allowed' => {
- type => 'string', format => 'pve-sdn-vlanrange',
- description => "Allowed vlan range",
- },
};
}
@@ -37,7 +33,6 @@ sub options {
return {
'uplink-id' => { optional => 0 },
- 'vlan-allowed' => { optional => 1 },
};
}
@@ -87,28 +82,6 @@ sub on_delete_hook {
sub on_update_hook {
my ($class, $transportid, $sdn_cfg) = @_;
- my $transport = $sdn_cfg->{ids}->{$transportid};
-
- # verify that vlan-allowed don't conflict with another vlan-allowed transport
-
- # verify that vlan-allowed is matching currently vnet tag in this transport
- my $vlanallowed = $transport->{'vlan-allowed'};
- if ($vlanallowed) {
- foreach my $id (keys %{$sdn_cfg->{ids}}) {
- my $sdn = $sdn_cfg->{ids}->{$id};
- if ($sdn->{type} eq 'vnet' && defined($sdn->{tag})) {
- if(defined($sdn->{zone}) && $sdn->{zone} eq $transportid) {
- my $tag = $sdn->{tag};
- eval {
- PVE::Network::SDN::Zones::Plugin::parse_tag_number_or_range($vlanallowed, '4096', $tag);
- };
- if($@) {
- die "vlan $tag is not allowed in transport $transportid";
- }
- }
- }
- }
- }
}
1;
diff --git a/PVE/Network/SDN/Zones/VxlanPlugin.pm b/PVE/Network/SDN/Zones/VxlanPlugin.pm
index bcabe1e..8ae3ce8 100644
--- a/PVE/Network/SDN/Zones/VxlanPlugin.pm
+++ b/PVE/Network/SDN/Zones/VxlanPlugin.pm
@@ -42,10 +42,6 @@ sub type {
sub properties {
return {
- 'vxlan-allowed' => {
- type => 'string', format => 'pve-sdn-vxlanrange',
- description => "Allowed vlan range",
- },
'multicast-address' => {
description => "Multicast address.",
type => 'string', format => 'ipv4-multicast'
@@ -63,7 +59,6 @@ sub options {
'uplink-id' => { optional => 0 },
'multicast-address' => { optional => 1 },
'unicast-address' => { optional => 1 },
- 'vxlan-allowed' => { optional => 1 },
};
}
@@ -80,7 +75,6 @@ sub generate_sdn_config {
my @unicastaddress = split(',', $plugin_config->{'unicast-address'}) if $plugin_config->{'unicast-address'};
my $uplink = $plugin_config->{'uplink-id'};
- my $vxlanallowed = $plugin_config->{'vxlan-allowed'};
die "missing vxlan tag" if !$tag;
my $iface = "uplink$uplink";
@@ -142,29 +136,6 @@ sub on_delete_hook {
sub on_update_hook {
my ($class, $transportid, $sdn_cfg) = @_;
- my $transport = $sdn_cfg->{ids}->{$transportid};
-
- # verify that vxlan-allowed don't conflict with another vxlan-allowed transport
-
- # verify that vxlan-allowed is matching currently vnet tag in this transport
- my $vxlanallowed = $transport->{'vxlan-allowed'};
- if ($vxlanallowed) {
- foreach my $id (keys %{$sdn_cfg->{ids}}) {
- my $sdn = $sdn_cfg->{ids}->{$id};
- if ($sdn->{type} eq 'vnet' && defined($sdn->{tag})) {
- if(defined($sdn->{zone}) && $sdn->{zone} eq $transportid) {
- my $tag = $sdn->{tag};
- eval {
- PVE::Network::SDN::Zones::Plugin::parse_tag_number_or_range($vxlanallowed, '16777216', $tag);
- };
- if($@) {
- die "vnet $id - vlan $tag is not allowed in transport $transportid";
- }
- }
- }
- }
- }
-
# verify that router exist
if (defined($sdn_cfg->{ids}->{$transportid}->{router})) {
my $router = $sdn_cfg->{ids}->{$transportid}->{router};
--
2.20.1
More information about the pve-devel
mailing list