Commit a8a32a62 authored by Robert Ricci's avatar Robert Ricci

Fix for some really stupid Cisco behavior

Some Ciscos limit the number of trunks on which you can configure
'extended range' VLANs (above 1k). This includes clearing them from
the trunk (eg. you don't actually have to be *using* them to get
this error). So, as a workaround, if the stack is not conifgured
to use VLANs over 1k, don't clear this range when cleaning out
trunk ports.
parent 7181889f
......@@ -108,6 +108,17 @@ sub new($$$;$) {
return undef;
}
#
# Cisco considers anything over 1k an 'extended' VLAN. There are some
# issues with supporing these on certain devices, so we want to know if
# we'll ever be called on to make VLANs in the extended range.
#
if ($self->{MAX_VLAN} > 1000) {
$self->{EXTENDED_VLANS} = 1;
} else {
$self->{EXTENDED_VLANS} = 0;
}
if ($community) { # Allow this to over-ride the default
$self->{COMMUNITY} = $community;
} else {
......@@ -1398,8 +1409,17 @@ sub vlanTrunkUtil($$$$) {
my ($bitfield, %vranges, @result);
if ($op == $VOP_CLEARALL)
{ @result = @vlans = (1, 1025, 2049, 3073); }
if ($op == $VOP_CLEARALL) {
#
# Clear the 'extended range' VLANs iff they might be used on this
# switch
#
if ($self->{EXTENDED_VLANS}) {
@result = @vlans = (1, 1025, 2049, 3073);
} else {
@result = @vlans = (1);
}
}
foreach my $vlan (@vlans)
{ push @{$vranges{($vlan >> 10) & 3}}, $vlan; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment