[pve-devel] [PATCH] copy_bridge_config : parse values
Alexandre Derumier
aderumier at odiso.com
Tue Feb 25 06:15:03 CET 2014
fix bug
WARNING: Insecure dependency in system while running with -T switch at /usr/share/perl5/PVE/Network.pm line 175.
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
data/PVE/Network.pm | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/data/PVE/Network.pm b/data/PVE/Network.pm
index 98ef18e..99350cb 100644
--- a/data/PVE/Network.pm
+++ b/data/PVE/Network.pm
@@ -168,6 +168,15 @@ sub copy_bridge_config {
eval {
my $v0 = PVE::Tools::file_read_firstline("/sys/class/net/$br0/bridge/$sysname");
my $v1 = PVE::Tools::file_read_firstline("/sys/class/net/$br1/bridge/$sysname");
+
+ if($v0 =~ m/^(\S+)/){
+ $v0 = $1;
+ }
+
+ if($v1 =~ m/^(\S+)/){
+ $v1 = $1;
+ }
+
if ($v0 ne $v1) {
system("echo \"$v0\" > /sys/class/net/$br1/bridge/$sysname") == 0 ||
warn "unable to set bridge config '$sysname'\n";
--
1.7.10.4
More information about the pve-devel
mailing list