From: Wolfgang Bumiller Date: Mon, 6 Mar 2017 14:35:39 +0000 (+0100) Subject: net: only disable ipv6 on actual creation X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=86b8423739ccac26a115625bc002d6ef51d17a52 net: only disable ipv6 on actual creation And leave it alone if the interface already existed. --- diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm index 69051b9..c8bd8ab 100644 --- a/src/PVE/Network.pm +++ b/src/PVE/Network.pm @@ -166,8 +166,9 @@ my $cond_create_bridge = sub { my ($bridge) = @_; if (! -d "/sys/class/net/$bridge") { - system("/sbin/brctl addbr $bridge") == 0 || - die "can't add bridge '$bridge'\n"; + system("/sbin/brctl addbr $bridge") == 0 || + die "can't add bridge '$bridge'\n"; + disable_ipv6($bridge); } }; @@ -287,7 +288,6 @@ my $create_firewall_bridge_linux = sub { my ($fwbr, $vethfw, $vethfwpeer) = &$compute_fwbr_names($vmid, $devid); &$cond_create_bridge($fwbr); - disable_ipv6($fwbr); &$activate_interface($fwbr); copy_bridge_config($bridge, $fwbr); @@ -308,7 +308,6 @@ my $create_firewall_bridge_ovs = sub { my $bridgemtu = &$read_bridge_mtu($bridge); &$cond_create_bridge($fwbr); - disable_ipv6($fwbr); &$activate_interface($fwbr); &$bridge_add_interface($fwbr, $iface); @@ -429,10 +428,10 @@ sub activate_bridge_vlan_slave { if (! -d "/sys/class/net/$ifacevlan") { system("/sbin/ip link add link $iface name $ifacevlan type vlan id $tag") == 0 || die "can't add vlan tag $tag to interface $iface\n"; - } - # remove ipv6 link-local address before activation - disable_ipv6($ifacevlan); + # remove ipv6 link-local address before activation + disable_ipv6($ifacevlan); + } # be sure to have the $ifacevlan up &$activate_interface($ifacevlan);