* [pve-devel] [PATCH network v2 0/3] Advertise MTU via DHCP / RA
@ 2024-04-22 13:15 Stefan Hanreich
2024-04-22 13:15 ` [pve-devel] [PATCH pve-network v2 1/3] dhcp: fix function signatures in abstract class Stefan Hanreich
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Stefan Hanreich @ 2024-04-22 13:15 UTC (permalink / raw)
To: pve-devel
Changes from v1 -> v2:
* rebased branch, everything else unchanged
pve-network:
Stefan Hanreich (3):
dhcp: fix function signatures in abstract class
zones: add method for getting MTU
dhcp: dnsmasq: send mtu option via dhcp
src/PVE/Network/SDN/Dhcp.pm | 2 +-
src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 7 ++++++-
src/PVE/Network/SDN/Dhcp/Plugin.pm | 12 ++++++------
src/PVE/Network/SDN/Zones.pm | 8 ++++++++
src/PVE/Network/SDN/Zones/Plugin.pm | 7 +++++++
src/PVE/Network/SDN/Zones/SimplePlugin.pm | 8 +++++++-
6 files changed, 35 insertions(+), 9 deletions(-)
Summary over all repositories:
6 files changed, 35 insertions(+), 9 deletions(-)
--
Generated by git-murpp 0.6.0
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pve-devel] [PATCH pve-network v2 1/3] dhcp: fix function signatures in abstract class
2024-04-22 13:15 [pve-devel] [PATCH network v2 0/3] Advertise MTU via DHCP / RA Stefan Hanreich
@ 2024-04-22 13:15 ` Stefan Hanreich
2024-04-22 13:15 ` [pve-devel] [PATCH pve-network v2 2/3] zones: add method for getting MTU Stefan Hanreich
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hanreich @ 2024-04-22 13:15 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
src/PVE/Network/SDN/Dhcp/Plugin.pm | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/PVE/Network/SDN/Dhcp/Plugin.pm b/src/PVE/Network/SDN/Dhcp/Plugin.pm
index b99f598..6e985cd 100644
--- a/src/PVE/Network/SDN/Dhcp/Plugin.pm
+++ b/src/PVE/Network/SDN/Dhcp/Plugin.pm
@@ -28,12 +28,12 @@ sub add_ip_mapping {
}
sub configure_range {
- my ($class, $dhcpid, $vnetid, $subnet_config, $range_config) = @_;
+ my ($class, $config, $dhcpid, $vnetid, $subnet_config, $range_config) = @_;
die 'implement in sub class';
}
sub configure_subnet {
- my ($class, $dhcpid, $vnetid, $subnet_config) = @_;
+ my ($class, $config, $dhcpid, $vnetid, $subnet_config) = @_;
die 'implement in sub class';
}
@@ -43,22 +43,22 @@ sub configure_vnet {
}
sub before_configure {
- my ($class, $dhcp_config) = @_;
+ my ($class, $dhcpid) = @_;
die 'implement in sub class';
}
sub after_configure {
- my ($class, $dhcp_config) = @_;
+ my ($class, $dhcpid, $noerr) = @_;
die 'implement in sub class';
}
sub before_regenerate {
- my ($class) = @_;
+ my ($class, $noerr) = @_;
die 'implement in sub class';
}
sub after_regenerate {
- my ($class, $dhcp_config) = @_;
+ my ($class) = @_;
die 'implement in sub class';
}
--
2.39.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pve-devel] [PATCH pve-network v2 2/3] zones: add method for getting MTU
2024-04-22 13:15 [pve-devel] [PATCH network v2 0/3] Advertise MTU via DHCP / RA Stefan Hanreich
2024-04-22 13:15 ` [pve-devel] [PATCH pve-network v2 1/3] dhcp: fix function signatures in abstract class Stefan Hanreich
@ 2024-04-22 13:15 ` Stefan Hanreich
2024-04-22 13:15 ` [pve-devel] [PATCH pve-network v2 3/3] dhcp: dnsmasq: send mtu option via dhcp Stefan Hanreich
2024-04-22 14:22 ` [pve-devel] applied: [PATCH network v2 0/3] Advertise MTU via DHCP / RA Thomas Lamprecht
3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hanreich @ 2024-04-22 13:15 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
src/PVE/Network/SDN/Zones.pm | 8 ++++++++
src/PVE/Network/SDN/Zones/Plugin.pm | 7 +++++++
src/PVE/Network/SDN/Zones/SimplePlugin.pm | 8 +++++++-
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/src/PVE/Network/SDN/Zones.pm b/src/PVE/Network/SDN/Zones.pm
index 5bd3536..c1c7745 100644
--- a/src/PVE/Network/SDN/Zones.pm
+++ b/src/PVE/Network/SDN/Zones.pm
@@ -27,6 +27,7 @@ PVE::Network::SDN::Zones::SimplePlugin->register();
PVE::Network::SDN::Zones::Plugin->init();
my $local_network_sdn_file = "/etc/network/interfaces.d/sdn";
+my $default_mtu = 1500;
sub sdn_zones_config {
my ($cfg, $id, $noerr) = @_;
@@ -369,5 +370,12 @@ sub del_bridge_fdb {
$plugin->del_bridge_fdb($plugin_config, $iface, $macaddr);
}
+sub get_mtu {
+ my ($zone_config) = @_;
+
+ my $plugin = PVE::Network::SDN::Zones::Plugin->lookup($zone_config->{type});
+ return $plugin->get_mtu($zone_config) // $default_mtu;
+}
+
1;
diff --git a/src/PVE/Network/SDN/Zones/Plugin.pm b/src/PVE/Network/SDN/Zones/Plugin.pm
index 247d0b2..26cc0da 100644
--- a/src/PVE/Network/SDN/Zones/Plugin.pm
+++ b/src/PVE/Network/SDN/Zones/Plugin.pm
@@ -361,4 +361,11 @@ sub datacenter_config {
return PVE::Cluster::cfs_read_file('datacenter.cfg');
}
+
+sub get_mtu {
+ my ($class, $plugin_config) = @_;
+
+ die "please implement inside plugin";
+}
+
1;
diff --git a/src/PVE/Network/SDN/Zones/SimplePlugin.pm b/src/PVE/Network/SDN/Zones/SimplePlugin.pm
index 65e9ad4..1416d39 100644
--- a/src/PVE/Network/SDN/Zones/SimplePlugin.pm
+++ b/src/PVE/Network/SDN/Zones/SimplePlugin.pm
@@ -56,7 +56,7 @@ sub generate_sdn_config {
my $mac = $vnet->{mac};
my $alias = $vnet->{alias};
- my $mtu = $plugin_config->{mtu} if $plugin_config->{mtu};
+ my $mtu = $class->get_mtu($plugin_config);
# vnet bridge
my @iface_config = ();
@@ -144,6 +144,12 @@ sub vnet_update_hook {
}
}
+sub get_mtu {
+ my ($class, $plugin_config) = @_;
+
+ return $plugin_config->{mtu};
+}
+
1;
--
2.39.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pve-devel] [PATCH pve-network v2 3/3] dhcp: dnsmasq: send mtu option via dhcp
2024-04-22 13:15 [pve-devel] [PATCH network v2 0/3] Advertise MTU via DHCP / RA Stefan Hanreich
2024-04-22 13:15 ` [pve-devel] [PATCH pve-network v2 1/3] dhcp: fix function signatures in abstract class Stefan Hanreich
2024-04-22 13:15 ` [pve-devel] [PATCH pve-network v2 2/3] zones: add method for getting MTU Stefan Hanreich
@ 2024-04-22 13:15 ` Stefan Hanreich
2024-04-22 14:22 ` [pve-devel] applied: [PATCH network v2 0/3] Advertise MTU via DHCP / RA Thomas Lamprecht
3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hanreich @ 2024-04-22 13:15 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
src/PVE/Network/SDN/Dhcp.pm | 2 +-
src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 7 ++++++-
src/PVE/Network/SDN/Dhcp/Plugin.pm | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/PVE/Network/SDN/Dhcp.pm b/src/PVE/Network/SDN/Dhcp.pm
index 7876c08..d48de34 100644
--- a/src/PVE/Network/SDN/Dhcp.pm
+++ b/src/PVE/Network/SDN/Dhcp.pm
@@ -84,7 +84,7 @@ sub regenerate_config {
die "Could not find DHCP plugin: $dhcp_plugin_name" if !$dhcp_plugin;
- eval { $dhcp_plugin->before_configure($zoneid) };
+ eval { $dhcp_plugin->before_configure($zoneid, $zone) };
die "Could not run before_configure for DHCP server $zoneid $@\n" if $@;
for my $vnetid (sort keys %{$vnet_cfg->{ids}}) {
diff --git a/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm b/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm
index c14f5d7..ae52d31 100644
--- a/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm
+++ b/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm
@@ -177,7 +177,7 @@ sub systemctl_service {
}
sub before_configure {
- my ($class, $dhcpid) = @_;
+ my ($class, $dhcpid, $zone_cfg) = @_;
my $dbus_config = <<DBUSCFG;
<!DOCTYPE busconfig PUBLIC
@@ -218,6 +218,8 @@ CFG
$default_config
);
+ my $mtu = PVE::Network::SDN::Zones::get_mtu($zone_cfg);
+
my $default_dnsmasq_config = <<CFG;
except-interface=lo
enable-ra
@@ -228,6 +230,9 @@ dhcp-leasefile=$DNSMASQ_LEASE_ROOT/dnsmasq.$dhcpid.leases
dhcp-hostsfile=$config_directory/ethers
dhcp-ignore=tag:!known
+dhcp-option=26,$mtu
+ra-param=*,mtu:$mtu,0
+
# Send an empty WPAD option. This may be REQUIRED to get windows 7 to behave.
dhcp-option=252,"\\n"
diff --git a/src/PVE/Network/SDN/Dhcp/Plugin.pm b/src/PVE/Network/SDN/Dhcp/Plugin.pm
index 6e985cd..1757915 100644
--- a/src/PVE/Network/SDN/Dhcp/Plugin.pm
+++ b/src/PVE/Network/SDN/Dhcp/Plugin.pm
@@ -43,7 +43,7 @@ sub configure_vnet {
}
sub before_configure {
- my ($class, $dhcpid) = @_;
+ my ($class, $dhcpid, $zone_config) = @_;
die 'implement in sub class';
}
--
2.39.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pve-devel] applied: [PATCH network v2 0/3] Advertise MTU via DHCP / RA
2024-04-22 13:15 [pve-devel] [PATCH network v2 0/3] Advertise MTU via DHCP / RA Stefan Hanreich
` (2 preceding siblings ...)
2024-04-22 13:15 ` [pve-devel] [PATCH pve-network v2 3/3] dhcp: dnsmasq: send mtu option via dhcp Stefan Hanreich
@ 2024-04-22 14:22 ` Thomas Lamprecht
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2024-04-22 14:22 UTC (permalink / raw)
To: Proxmox VE development discussion, Stefan Hanreich
Am 22/04/2024 um 15:15 schrieb Stefan Hanreich:
> Changes from v1 -> v2:
> * rebased branch, everything else unchanged
>
> pve-network:
>
> Stefan Hanreich (3):
> dhcp: fix function signatures in abstract class
> zones: add method for getting MTU
> dhcp: dnsmasq: send mtu option via dhcp
>
> src/PVE/Network/SDN/Dhcp.pm | 2 +-
> src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 7 ++++++-
> src/PVE/Network/SDN/Dhcp/Plugin.pm | 12 ++++++------
> src/PVE/Network/SDN/Zones.pm | 8 ++++++++
> src/PVE/Network/SDN/Zones/Plugin.pm | 7 +++++++
> src/PVE/Network/SDN/Zones/SimplePlugin.pm | 8 +++++++-
> 6 files changed, 35 insertions(+), 9 deletions(-)
>
>
> Summary over all repositories:
> 6 files changed, 35 insertions(+), 9 deletions(-)
>
applied series, thanks!
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-04-22 14:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-22 13:15 [pve-devel] [PATCH network v2 0/3] Advertise MTU via DHCP / RA Stefan Hanreich
2024-04-22 13:15 ` [pve-devel] [PATCH pve-network v2 1/3] dhcp: fix function signatures in abstract class Stefan Hanreich
2024-04-22 13:15 ` [pve-devel] [PATCH pve-network v2 2/3] zones: add method for getting MTU Stefan Hanreich
2024-04-22 13:15 ` [pve-devel] [PATCH pve-network v2 3/3] dhcp: dnsmasq: send mtu option via dhcp Stefan Hanreich
2024-04-22 14:22 ` [pve-devel] applied: [PATCH network v2 0/3] Advertise MTU via DHCP / RA Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox