]> git.puffer.fish Git - mirror/pve-network.git/commitdiff
dhcp: dnsmasq: send mtu option via dhcp
authorStefan Hanreich <s.hanreich@proxmox.com>
Mon, 22 Apr 2024 13:15:34 +0000 (15:15 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 22 Apr 2024 13:22:08 +0000 (15:22 +0200)
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
src/PVE/Network/SDN/Dhcp.pm
src/PVE/Network/SDN/Dhcp/Dnsmasq.pm
src/PVE/Network/SDN/Dhcp/Plugin.pm

index 7876c080a2db727aa5c368b338735797a24a4559..d48de3421568239e20ccb45d98c920c2f36c4c2f 100644 (file)
@@ -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}}) {
index c14f5d7eb4a8e4630708c719f46b4d026f28dc4f..ae52d3199e0fc51fd1401d7dd78085ad730e5588 100644 (file)
@@ -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"
 
index 6e985cd086d7e02ac624b27bf0ec5a14673e60af..175791536e3889b5168453c7215d2ef82efaab96 100644 (file)
@@ -43,7 +43,7 @@ sub configure_vnet {
 }
 
 sub before_configure {
-    my ($class, $dhcpid) = @_;
+    my ($class, $dhcpid, $zone_config) = @_;
     die 'implement in sub class';
 }