X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=data%2FPVE%2FNetwork.pm;h=8f82686a8febf3c4493e1270403c1027fb76f75e;hp=aca6b29d1105bfd93ceb770f07295bddae7dc2e6;hb=a84b65c0da5eb1c1e3a3d4c51f01e24aa577253e;hpb=3aa99c70062f122dfe8bcb9a97789d6d97686fd4 diff --git a/data/PVE/Network.pm b/data/PVE/Network.pm index aca6b29..8f82686 100644 --- a/data/PVE/Network.pm +++ b/data/PVE/Network.pm @@ -64,6 +64,25 @@ sub tap_create { die "interface activation failed\n" if $@; } +sub tap_plug { + my ($iface, $bridge, $tag) = @_; + + my $newbridge = activate_bridge_vlan($bridge, $tag); + copy_bridge_config($bridge, $newbridge) if $bridge ne $newbridge; + + system ("/usr/sbin/brctl addif $newbridge $iface") == 0 || + die "can't add interface to bridge\n"; +} + +sub tap_unplug { + my ($iface, $bridge, $tag) = @_; + + $bridge .= "v$tag" if $tag; + + system ("/usr/sbin/brctl delif $bridge $iface") == 0 || + die "can't del interface from bridge\n"; +} + sub copy_bridge_config { my ($br0, $br1) = @_;