]> git.proxmox.com Git - pve-common.git/commitdiff
Revert "pve-common: PVE/Network: rework of activate_bridge_vlan"
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 13 Feb 2013 09:53:49 +0000 (10:53 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 13 Feb 2013 09:53:49 +0000 (10:53 +0100)
This reverts commit fa49ab1a0875a89230378c99b4b6f9ccfa0edb6b.

This still cause problems with bonding device. Nobody really knows
whats wrong. Also, this is not fully compatible with existing setups.

data/PVE/Network.pm

index fd5207efe2f2f6294736ba1ab31f53a31fd50e7a..c20951eac65660c417ed73eb4fa227247474bcec 100644 (file)
@@ -72,14 +72,28 @@ sub activate_bridge_vlan {
     die "got strange vlan tag '$tag_param'\n" if $tag < 1 || $tag > 4094;
 
     my $bridgevlan = "${bridge}v$tag";
     die "got strange vlan tag '$tag_param'\n" if $tag < 1 || $tag > 4094;
 
     my $bridgevlan = "${bridge}v$tag";
-    my $iface = $bridge;
+
+    my $dir = "/sys/class/net/$bridge/brif";
+
+    #check if we have an only one ethX or bondX interface in the bridge
+    
+    my $iface;
+    PVE::Tools::dir_glob_foreach($dir, '((eth|bond)\d+)', sub {
+       my ($slave) = @_;
+
+       die "more then one physical interfaces on bridge '$bridge'\n" if $iface;
+       $iface = $slave;
+
+    });
+
+    die "no physical interface on bridge '$bridge'\n" if !$iface;
+
     my $ifacevlan = "${iface}.$tag";
     my $ifacevlan = "${iface}.$tag";
-    my $vlanflags = "reorder_hdr on gvrp on";
 
     # create vlan on $iface is not already exist
     if (! -d "/sys/class/net/$ifacevlan") {
 
     # create vlan on $iface is not already exist
     if (! -d "/sys/class/net/$ifacevlan") {
-      system("/sbin/ip link add link $iface name $ifacevlan type vlan id $tag $vlanflags") == 0 ||
-          die "can't add vlan tag $tag to interface $iface\n";
+       system("/sbin/vconfig add $iface $tag") == 0 ||
+           die "can't add vlan tag $tag to interface $iface\n";
     }
 
     # be sure to have the $ifacevlan up
     }
 
     # be sure to have the $ifacevlan up