[#172] Native VLAN change compatible with Cisco (trunk/access) and Others

This will first try to set the pvid (Cisco trunk),
and then use vlan (everything else).

Ideally we instead get SNMP::Info to make a smart choice which was the
intention behind set_i_untagged, but it's broken at the moment.
This commit is contained in:
Oliver Gorwits
2014-11-19 22:20:12 +00:00
parent 16c4d9cfbe
commit 2f6c2c0cdb
2 changed files with 4 additions and 1 deletions

View File

@@ -54,7 +54,9 @@ sub vlan {
return job_error("Cannot alter vlan: $vlan_reconfig_check")
if $vlan_reconfig_check;
return _set_port_generic($job, 'untagged', 'vlan');
my @stat = _set_port_generic($job, 'pvid'); # for Cisco trunk
return @stat if $stat[0] eq 'done';
return _set_port_generic($job, 'vlan');
}
sub _set_port_generic {