public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH pve-network 1/3] dhcp: add vrf support
Date: Mon, 18 Dec 2023 18:10:06 +0100	[thread overview]
Message-ID: <30ebe48d-dee8-41a3-a13a-d4a8d7de137d@proxmox.com> (raw)
In-Reply-To: <20231218130431.1857324-2-aderumier@odiso.com>



On 12/18/23 14:04, Alexandre Derumier wrote:
> launch dnsmasq in a vrf context with "ip vrf exec <vrfname> dnsmasq.."
> 
> use "default" vrf if plugin don't return a specific vrf
> 
> Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
> ---
>  src/PVE/Network/SDN/Dhcp.pm             |  3 ++-
>  src/PVE/Network/SDN/Dhcp/Dnsmasq.pm     |  3 ++-
>  src/PVE/Network/SDN/Zones.pm            | 10 ++++++++++
>  src/PVE/Network/SDN/Zones/EvpnPlugin.pm |  6 ++++++
>  src/PVE/Network/SDN/Zones/Plugin.pm     |  6 ++++++
>  5 files changed, 26 insertions(+), 2 deletions(-)
> 
> diff --git a/src/PVE/Network/SDN/Dhcp.pm b/src/PVE/Network/SDN/Dhcp.pm
> index 7876c08..7b5e31f 100644
> --- a/src/PVE/Network/SDN/Dhcp.pm
> +++ b/src/PVE/Network/SDN/Dhcp.pm
> @@ -79,12 +79,13 @@ sub regenerate_config {
>          my $zone = $zone_cfg->{ids}->{$zoneid};
>          next if !$zone->{dhcp};
>  
> +	my $vrf = PVE::Network::SDN::Zones::get_vrf($zoneid);
>  	my $dhcp_plugin_name = $zone->{dhcp};
>  	my $dhcp_plugin = PVE::Network::SDN::Dhcp::Plugin->lookup($dhcp_plugin_name);
>  
>  	die "Could not find DHCP plugin: $dhcp_plugin_name" if !$dhcp_plugin;
>  
> -	eval { $dhcp_plugin->before_configure($zoneid) };
> +	eval { $dhcp_plugin->before_configure($zoneid, $vrf) };

In my MTU series I already additionally pass in the zone config to the
DHCP plugin, since I did a similar thing (creating a getter) for MTU -
maybe we can unify this approach and call
PVE::Network::SDN::Zones::get_xy() inside the DHCP plugins or outside as
well?

I think I prefer calling it inside the DHCP plugin, since we then only
need to add one parameter instead of adding one for every additional
thing we might want to pass to the dhcp plugin.

See https://lists.proxmox.com/pipermail/pve-devel/2023-December/061111.html




  reply	other threads:[~2023-12-18 17:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18 13:04 [pve-devel] [PATCH pve-network 0/3] add dhcp support for evpn Alexandre Derumier
2023-12-18 13:04 ` [pve-devel] [PATCH pve-network 1/3] dhcp: add vrf support Alexandre Derumier
2023-12-18 17:10   ` Stefan Hanreich [this message]
2023-12-18 13:04 ` [pve-devel] [PATCH pve-network 2/3] dnsmasq service: run service in vrf Alexandre Derumier
2023-12-18 13:04 ` [pve-devel] [PATCH pve-network 3/3] zones: evpn: add dhcp support Alexandre Derumier
2023-12-18 14:42 ` [pve-devel] [PATCH pve-network 0/3] add dhcp support for evpn Stefan Hanreich
2023-12-18 17:05   ` Stefan Hanreich

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=30ebe48d-dee8-41a3-a13a-d4a8d7de137d@proxmox.com \
    --to=s.hanreich@proxmox.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