]> git.proxmox.com Git - pve-common.git/commitdiff
Inotify: forbid ip address on bridged interface.
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 9 Jan 2020 13:11:00 +0000 (14:11 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 11 Jan 2020 15:11:04 +0000 (16:11 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
src/PVE/INotify.pm

index 867da306197014d57fa3c8886db3833732de3cd4..b38d88764c6f4a97ece42833a3e394deb84cd3e4 100644 (file)
@@ -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;
            }