* [pve-devel] [PATCH pve-network 1/1] Update vxlan plugin to emit local tunnel IP [not found] <20241008040136.322811-1-andrew@apalrd.net> @ 2024-10-08 4:01 ` apalrd via pve-devel 2024-10-09 14:49 ` DERUMIER, Alexandre via pve-devel [not found] ` <20241008040136.322811-2-andrew@apalrd.net> 1 sibling, 1 reply; 3+ messages in thread From: apalrd via pve-devel @ 2024-10-08 4:01 UTC (permalink / raw) To: pve-devel; +Cc: apalrd [-- Attachment #1: Type: message/rfc822, Size: 6112 bytes --] From: apalrd <andrew@apalrd.net> To: pve-devel@lists.proxmox.com Cc: apalrd <andrew@apalrd.net> Subject: [PATCH pve-network 1/1] Update vxlan plugin to emit local tunnel IP Date: Tue, 8 Oct 2024 00:01:36 -0400 Message-ID: <20241008040136.322811-2-andrew@apalrd.net> --- src/PVE/Network/SDN/Zones/VxlanPlugin.pm | 4 ++-- src/test/zones/vxlan/basic/expected_sdn_interfaces | 1 + src/test/zones/vxlan/vlanawarevnet/expected_sdn_interfaces | 1 + src/test/zones/vxlan/vxlanport/expected_sdn_interfaces | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm index 9a77bb9..c3cf0ce 100644 --- a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm +++ b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm @@ -76,8 +76,8 @@ sub generate_sdn_config { push @iface_config, "vxlan-id $tag"; for my $address (@peers) { - next if $address eq $ifaceip; - push @iface_config, "vxlan_remoteip $address"; + push @iface_config, "vxlan_local_tunnelip $address" if $address eq $ifaceip; + push @iface_config, "vxlan_remoteip $address" if $address ne $ifaceip; } push @iface_config, "vxlan-port $vxlanport" if $vxlanport; diff --git a/src/test/zones/vxlan/basic/expected_sdn_interfaces b/src/test/zones/vxlan/basic/expected_sdn_interfaces index 7b73c3e..dd12d93 100644 --- a/src/test/zones/vxlan/basic/expected_sdn_interfaces +++ b/src/test/zones/vxlan/basic/expected_sdn_interfaces @@ -10,6 +10,7 @@ iface myvnet auto vxlan_myvnet iface vxlan_myvnet vxlan-id 100 + vxlan_local_tunnelip 192.168.0.1 vxlan_remoteip 192.168.0.2 vxlan_remoteip 192.168.0.3 mtu 1450 diff --git a/src/test/zones/vxlan/vlanawarevnet/expected_sdn_interfaces b/src/test/zones/vxlan/vlanawarevnet/expected_sdn_interfaces index 55cdf9c..e68ac4c 100644 --- a/src/test/zones/vxlan/vlanawarevnet/expected_sdn_interfaces +++ b/src/test/zones/vxlan/vlanawarevnet/expected_sdn_interfaces @@ -12,6 +12,7 @@ iface myvnet auto vxlan_myvnet iface vxlan_myvnet vxlan-id 100 + vxlan_local_tunnelip 192.168.0.1 vxlan_remoteip 192.168.0.2 vxlan_remoteip 192.168.0.3 mtu 1450 diff --git a/src/test/zones/vxlan/vxlanport/expected_sdn_interfaces b/src/test/zones/vxlan/vxlanport/expected_sdn_interfaces index 572550a..0a8804f 100644 --- a/src/test/zones/vxlan/vxlanport/expected_sdn_interfaces +++ b/src/test/zones/vxlan/vxlanport/expected_sdn_interfaces @@ -10,6 +10,7 @@ iface myvnet auto vxlan_myvnet iface vxlan_myvnet vxlan-id 100 + vxlan_local_tunnelip 192.168.0.1 vxlan_remoteip 192.168.0.2 vxlan_remoteip 192.168.0.3 vxlan-port 6000 -- 2.39.5 [-- Attachment #2: Type: text/plain, Size: 160 bytes --] _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pve-devel] [PATCH pve-network 1/1] Update vxlan plugin to emit local tunnel IP 2024-10-08 4:01 ` [pve-devel] [PATCH pve-network 1/1] Update vxlan plugin to emit local tunnel IP apalrd via pve-devel @ 2024-10-09 14:49 ` DERUMIER, Alexandre via pve-devel 0 siblings, 0 replies; 3+ messages in thread From: DERUMIER, Alexandre via pve-devel @ 2024-10-09 14:49 UTC (permalink / raw) To: pve-devel; +Cc: DERUMIER, Alexandre, andrew [-- Attachment #1: Type: message/rfc822, Size: 12327 bytes --] From: "DERUMIER, Alexandre" <alexandre.derumier@groupe-cyllene.com> To: "pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com> Cc: "andrew@apalrd.net" <andrew@apalrd.net> Subject: Re: [pve-devel] [PATCH pve-network 1/1] Update vxlan plugin to emit local tunnel IP Date: Wed, 9 Oct 2024 14:49:32 +0000 Message-ID: <00a6ee0bf0dfcd9a23bad9ed6ffc7d23bd495e62.camel@groupe-cyllene.com> patch logic seem to be ok for me. (I don't have tested it) >> >> for my $address (@peers) { >>- next if $address eq $ifaceip; >>- push @iface_config, "vxlan_remoteip $address"; >>+ push @iface_config, "vxlan_local_tunnelip $address" if $address eq $ifaceip; >>+ push @iface_config, "vxlan_remoteip $address" if $address ne $ifaceip; >> } just be carefull about the identation and maybe use a if/else [-- Attachment #2: Type: text/plain, Size: 160 bytes --] _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <20241008040136.322811-2-andrew@apalrd.net>]
* Re: [pve-devel] [PATCH pve-network 1/1] Update vxlan plugin to emit local tunnel IP [not found] ` <20241008040136.322811-2-andrew@apalrd.net> @ 2024-10-10 6:21 ` Thomas Lamprecht 0 siblings, 0 replies; 3+ messages in thread From: Thomas Lamprecht @ 2024-10-10 6:21 UTC (permalink / raw) To: apalrd, pve-devel An actual commit message would be good, including at least a reason for why this is done. Am 08/10/2024 um 06:01 schrieb apalrd: > --- > src/PVE/Network/SDN/Zones/VxlanPlugin.pm | 4 ++-- > src/test/zones/vxlan/basic/expected_sdn_interfaces | 1 + > src/test/zones/vxlan/vlanawarevnet/expected_sdn_interfaces | 1 + > src/test/zones/vxlan/vxlanport/expected_sdn_interfaces | 1 + > 4 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm > index 9a77bb9..c3cf0ce 100644 > --- a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm > +++ b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm > @@ -76,8 +76,8 @@ sub generate_sdn_config { > push @iface_config, "vxlan-id $tag"; > > for my $address (@peers) { > - next if $address eq $ifaceip; > - push @iface_config, "vxlan_remoteip $address"; As Alexandre said, use an if/else, or alternatively a ternary: my $vxlan_key = $address eq $ifaceip ? 'vxlan_local_tunnelip' : 'vxlan_remoteip'; push @iface_config, "$vxlan_key $address"; > + push @iface_config, "vxlan_local_tunnelip $address" if $address eq $ifaceip; > + push @iface_config, "vxlan_remoteip $address" if $address ne $ifaceip; > } > push @iface_config, "vxlan-port $vxlanport" if $vxlanport; > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-10 6:20 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20241008040136.322811-1-andrew@apalrd.net> 2024-10-08 4:01 ` [pve-devel] [PATCH pve-network 1/1] Update vxlan plugin to emit local tunnel IP apalrd via pve-devel 2024-10-09 14:49 ` DERUMIER, Alexandre via pve-devel [not found] ` <20241008040136.322811-2-andrew@apalrd.net> 2024-10-10 6:21 ` Thomas Lamprecht
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox