[pve-devel] [PATCH pve-common] read_bridge_mtu: public method instead private

Alexandre Derumier aderumier at odiso.com
Fri Apr 17 07:47:05 CEST 2020


---
 src/PVE/Network.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm
index 21c592c..1c7711c 100644
--- a/src/PVE/Network.pm
+++ b/src/PVE/Network.pm
@@ -115,7 +115,7 @@ sub tap_rate_limit {
     setup_tc_rate_limit($iface, $rate, $burst);
 }
 
-my $read_bridge_mtu = sub {
+sub read_bridge_mtu {
     my ($bridge) = @_;
 
     my $mtu = PVE::Tools::file_read_firstline("/sys/class/net/$bridge/mtu");
@@ -275,7 +275,7 @@ sub tap_create {
 
     die "unable to get bridge setting\n" if !$bridge;
 
-    my $bridgemtu = &$read_bridge_mtu($bridge);
+    my $bridgemtu = read_bridge_mtu($bridge);
 
     eval {
 	disable_ipv6($iface);
@@ -289,7 +289,7 @@ sub veth_create {
 
     die "unable to get bridge setting\n" if !$bridge;
 
-    my $bridgemtu = &$read_bridge_mtu($bridge);
+    my $bridgemtu = read_bridge_mtu($bridge);
 
     # create veth pair
     if (! -d "/sys/class/net/$veth") {
@@ -347,7 +347,7 @@ my $create_firewall_bridge_ovs = sub {
     my ($vmid, $devid) = &$parse_tap_device_name($iface);
     my ($fwbr, undef, undef, $ovsintport) = &$compute_fwbr_names($vmid, $devid);
 
-    my $bridgemtu = &$read_bridge_mtu($bridge);
+    my $bridgemtu = read_bridge_mtu($bridge);
 
     &$cond_create_bridge($fwbr);
     &$activate_interface($fwbr);
-- 
2.20.1




More information about the pve-devel mailing list