]> git.proxmox.com Git - pve-container.git/blobdiff - src/lxcnetaddbr
backup: log errors from rsync
[pve-container.git] / src / lxcnetaddbr
index 83052e19f0be4d6116470f85e5c647d195cc7d7f..f2db43341c0bca892c7ca4073952b6cd7e184a68 100755 (executable)
@@ -7,15 +7,8 @@ exit 0 if $ENV{LXC_NAME} && $ENV{LXC_NAME} !~ /^\d+$/;
 
 use PVE::LXC;
 use PVE::Tools qw(run_command);
-use PVE::Network;
 use PVE::ProcFSTools;
 
-my $have_sdn;
-eval {
-    require PVE::Network::SDN::Zones;
-    $have_sdn = 1;
-};
-
 die "got unexpected argument count\n" if scalar(@ARGV) != 5;
 
 my ($vmid, $arg2, $arg3, $type, $iface) = @ARGV;
@@ -43,12 +36,7 @@ die "unable to find network definition for interface '$iface'\n"
 
 my $net = PVE::LXC::Config->parse_lxc_network($netconf);
 
-my $tag = $net->{tag};
-my $firewall = $net->{firewall};
 my $bridge = $net->{bridge};
-my $trunks = $net->{trunks};
-my $rate = $net->{rate};
-
 die "missing bridge configuration" if !$bridge;
 
 if (-d "/sys/class/net/$iface") {
@@ -60,13 +48,7 @@ if (-d "/sys/class/net/$iface") {
 
     PVE::Tools::run_command("/sbin/ip link set dev $iface up mtu $bridgemtu");
     PVE::Tools::run_command("/sbin/ip addr add 0.0.0.0/0 dev $iface");
-
-    if ($have_sdn) {
-       PVE::Network::SDN::Zones::tap_plug($iface, $bridge, $tag, $firewall, $trunks, $rate);
-       PVE::Network::SDN::Zones::add_bridge_fdb($iface, $net->{hwaddr}, $bridge, $firewall);
-    } else {
-       PVE::Network::tap_plug($iface, $bridge, $tag, $firewall, $trunks, $rate, { mac => $net->{hwaddr}});
-    }
+    PVE::LXC::net_tap_plug($iface, $net);
 }
 
 exit 0;