public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexandre Derumier <aderumier@odiso.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH V2 pve-network 5/7] zones: evpn: fix exitnodes for snat
Date: Thu,  3 Dec 2020 10:19:40 +0100	[thread overview]
Message-ID: <20201203091942.2401958-6-aderumier@odiso.com> (raw)
In-Reply-To: <20201203091942.2401958-1-aderumier@odiso.com>

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 PVE/Network/SDN/Controllers/EvpnPlugin.pm | 3 ++-
 PVE/Network/SDN/Zones/EvpnPlugin.pm       | 9 ++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
index b997cca..6927921 100644
--- a/PVE/Network/SDN/Controllers/EvpnPlugin.pm
+++ b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
@@ -144,7 +144,8 @@ sub generate_controller_zone_config {
 	push(@{$config->{frr}->{router}->{"bgp $asn vrf $vrf"}->{"address-family"}->{"l2vpn evpn"}}, "route-target export $autortas:$vrfvxlan");
     }
 
-    my $is_gateway = grep { $_ eq $local_node } PVE::Tools::split_list($exitnodes);
+    my $is_gateway = $exitnodes->{$local_node};
+
     if ($is_gateway) {
 
 	@controller_config = ();
diff --git a/PVE/Network/SDN/Zones/EvpnPlugin.pm b/PVE/Network/SDN/Zones/EvpnPlugin.pm
index d833641..e6ee839 100644
--- a/PVE/Network/SDN/Zones/EvpnPlugin.pm
+++ b/PVE/Network/SDN/Zones/EvpnPlugin.pm
@@ -100,12 +100,11 @@ sub generate_sdn_config {
 	    push @iface_config, "address $gateway/$mask" if !defined($address->{$gateway});
 	    $address->{$gateway} = 1;
 	}
+
 	if ($subnet->{snat}) {
-	    my $gatewaynodes = $controller->{'gateway-nodes'};
-	    my $is_evpn_gateway = "";
-	    foreach my $evpn_gatewaynode (PVE::Tools::split_list($gatewaynodes)) {
-		$is_evpn_gateway = 1 if $evpn_gatewaynode eq $local_node;
-	    }
+
+	    my $is_evpn_gateway = $plugin_config->{'exitnodes'}->{$local_node};
+
             #find outgoing interface
             my ($outip, $outiface) = PVE::Network::SDN::Zones::Plugin::get_local_route_ip('8.8.8.8');
             if ($outip && $outiface && $is_evpn_gateway) {
-- 
2.20.1




  parent reply	other threads:[~2020-12-03  9:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03  9:19 [pve-devel] [PATCH V2 pve-network 0/7] various cleanups Alexandre Derumier
2020-12-03  9:19 ` [pve-devel] [PATCH V2 pve-network 1/7] evpn: frr: use datacenter default profile (lower timeouts) Alexandre Derumier
2020-12-03  9:19 ` [pve-devel] [PATCH V2 pve-network 2/7] get_local_vnets: display vnet alias in comments Alexandre Derumier
2020-12-03  9:19 ` [pve-devel] [PATCH V2 pve-network 3/7] use canonical ipv6 address (RFC 5952) everywhere Alexandre Derumier
2020-12-18 17:02   ` Thomas Lamprecht
2020-12-03  9:19 ` [pve-devel] [PATCH V2 pve-network 4/7] ipam : pve: don't register hostname/description Alexandre Derumier
2020-12-03  9:19 ` Alexandre Derumier [this message]
2020-12-03  9:19 ` [pve-devel] [PATCH V2 pve-network 6/7] zones: plugin : readd encode/decode value Alexandre Derumier
2020-12-03  9:19 ` [pve-devel] [PATCH V2 pve-network 7/7] subnets: api : add missing param in on_update_hook for update Alexandre Derumier
2020-12-18 16:59 ` [pve-devel] applied-series: Re: [PATCH V2 pve-network 0/7] various cleanups Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201203091942.2401958-6-aderumier@odiso.com \
    --to=aderumier@odiso.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal