[pve-devel] [PATCH V2 pve-common 1/4] Inotify: forbid ip address on bridged interface.
Alexandre Derumier
aderumier at odiso.com
Thu Jan 9 14:11:00 CET 2020
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
src/PVE/INotify.pm | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 867da30..b38d887 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -1512,6 +1512,10 @@ 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 "\:\:");
+
&$check_mtu($ifaces, $iface, $p);
$bridgeports->{$p} = $iface;
}
--
2.20.1
More information about the pve-devel
mailing list