projects
/
pve-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3aa99c7
)
network : add tap_plug
author
Alexandre Derumier
<aderumier@odiso.com>
Tue, 5 Mar 2013 09:23:46 +0000
(10:23 +0100)
committer
Dietmar Maurer
<dietmar@proxmox.com>
Tue, 5 Mar 2013 11:02:23 +0000
(12:02 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
data/PVE/Network.pm
patch
|
blob
|
blame
|
history
diff --git
a/data/PVE/Network.pm
b/data/PVE/Network.pm
index
aca6b29
..
a7e55d7
100644
(file)
--- a/
data/PVE/Network.pm
+++ b/
data/PVE/Network.pm
@@
-64,6
+64,16
@@
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 copy_bridge_config {
my ($br0, $br1) = @_;