[pve-devel] [PATCH common] vlan fixups: remove existing vlan ids

Dietmar Maurer dietmar at proxmox.com
Tue Jun 21 06:55:40 CEST 2016


applied. I wonder why there is no 'bridge vlan set' command?

> add_interface = sub {
>  
>     if ($vlan_aware) {
>  	if ($tag) {
> -	    system("/sbin/bridge vlan add dev $iface vid $tag pvid untagged") == 0
> ||
> -	    die "unable to add vlan $tag to interface $iface\n";
> +	    system({'/sbin/bridge'} 'bridge', 'vlan', 'del', 'dev', $iface, 'vid',
> '1-4094') == 0
> +		or die "failed to remove default vlan tags of $iface\n";
> +	    system({'/sbin/bridge'} 'bridge', 'vlan', 'add', 'dev', $iface, 'vid',
> $tag, 'pvid', 'untagged') == 0
> +		or die "unable to add vlan $tag to interface $iface\n";
>  
>  	    warn "Caution: Setting VLAN ID 1 on a VLAN aware bridge may be
> dangerous\n" if $tag == 1;
>  	} else {
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 




More information about the pve-devel mailing list