--- pve-container/src/Makefile.lxcnetdelbr 2017-10-23 12:42:08.225637829 +0300 +++ pve-container/src/Makefile 2017-10-23 12:43:27.853741072 +0300 @@ -39,6 +39,7 @@ install: pct lxc-pve.conf lxc-pve-presta install -m 0755 pve-update-lxc-config ${SBINDIR} install -d ${LXC_SCRIPT_DIR} install -m 0755 lxcnetaddbr ${LXC_SCRIPT_DIR} + install -m 0755 lxcnetdelbr ${LXC_SCRIPT_DIR} install -m 0755 pve-container-stop-wrapper ${LXC_SCRIPT_DIR} install -d -m0755 ${SERVICEDIR} install -m0644 pve-container@.service ${SERVICEDIR}/ --- pve-container/src/lxcnetdelbr.lxcnetdelbr 2017-10-23 12:42:08.265637880 +0300 +++ pve-container/src/lxcnetdelbr 2017-10-23 12:42:08.265637880 +0300 @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +exit 0 if $ENV{LXC_NAME} && $ENV{LXC_NAME} !~ /^\d+$/; + +use PVE::Network; + +die "got unexpected argument count\n" if scalar(@ARGV) != 5; + +my ($vmid, $arg2, $arg3, $type, $iface) = @ARGV; + +die "got unexpected argument ($arg2 != net)\n" if $arg2 ne 'net'; +die "got unexpected argument ($arg3 != down)\n" if $arg3 ne 'down'; +die "got unexpected argument ($type != veth)\n" if $type ne 'veth'; +die "got unexpected environment" if $vmid ne $ENV{LXC_NAME}; +die "missing vmid parameter\n" if !$vmid; +die "missing iface parameter\n" if !$iface; + +PVE::Network::tap_unplug($iface); + +exit 0;