[pve-devel] [PATCH pve-common 2/3] INotify: check bridge ip: add missing check if method is not defined

Alexandre Derumier aderumier at odiso.com
Fri Feb 7 12:40:27 CET 2020


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

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 6e7a78c..7becbde 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -1562,8 +1562,8 @@ sub __write_etc_network_interfaces {
 		my $n = $ifaces->{$p};
 		die "bridge '$iface' - unable to find bridge port '$p'\n" if !$n;
 		die "iface $p - ip address can't be set on interface if bridged in $iface\n"
-		    if ($n->{method} eq 'static' && $n->{address} ne '0.0.0.0') ||
-		       ($n->{method6} eq 'static' && $n->{address} ne '::');
+		    if ($n->{method} && $n->{method} eq 'static' && $n->{address} ne '0.0.0.0') ||
+		       ($n->{method6} && $n->{method6} eq 'static' && $n->{address} ne '::');
 
 		&$check_mtu($ifaces, $p, $iface);
 		$bridgeports->{$p} = $iface;
-- 
2.20.1




More information about the pve-devel mailing list