[pve-devel] [PATCH pve-common 2/5] Inotify: forbid ip address on bridged interface.

Alexandre Derumier aderumier at odiso.com
Wed Jan 8 04:31:07 CET 2020


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 src/PVE/INotify.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 867da30..5c15926 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -1512,6 +1512,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->{method6} eq 'static') && $n->{address} ne '0.0.0.0' && $n->{address6} ne '0.0.0.0';
+
 		&$check_mtu($ifaces, $iface, $p);
 		$bridgeports->{$p} = $iface;
 	    }
-- 
2.20.1




More information about the pve-devel mailing list