]> git.proxmox.com Git - pve-common.git/commitdiff
fix #4299: network : disable_ipv6: fix path checking
authorAlexandre Derumier <aderumier@odiso.com>
Wed, 19 Oct 2022 22:24:29 +0000 (00:24 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 16 Jan 2023 09:42:06 +0000 (10:42 +0100)
It's possible to have a
/proc/sys/net/ipv6/ directory

but no
/proc/sys/net/ipv6/conf/$iface/disable_ipv6

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
src/PVE/Network.pm

index d1d2e5ed5c64985d774f9307f59e76e5a2e57154..355637b15086278e15751f32167cf61ff2c2b773 100644 (file)
@@ -210,8 +210,8 @@ my $cond_create_bridge = sub {
 
 sub disable_ipv6 {
     my ($iface) = @_;
-    return if !-d '/proc/sys/net/ipv6'; # ipv6 might be completely disabled
     my $file = "/proc/sys/net/ipv6/conf/$iface/disable_ipv6";
+    return if !-e $file; # ipv6 might be completely disabled
     open(my $fh, '>', $file) or die "failed to open $file for writing: $!\n";
     print {$fh} "1\n" or die "failed to disable link-local ipv6 for $iface\n";
     close($fh);