Commit 60ac4df1 authored by Timothy Stack's avatar Timothy Stack
Browse files

When setting up a trunk. Print a warning if a port isn't in an

EtherChannel and try another trunk port before giving up altogether.
parent 618a24ce
......@@ -1390,6 +1390,10 @@ sub setVlansOnTrunk($$$$) {
# this is _always_ beneficial, though
#
my $channel = snmpitGetFatal($self->{SESS},["pagpGroupIfIndex",$ifIndex]);
if (!($channel =~ /^\d+$/) || ($channel == 0)) {
print "WARNING: setVlansOnTrunk got zero channel for $self->{NAME}.$modport\n";
return 0;
}
if (($channel =~ /^\d+$/) && ($channel != 0)) {
$ifIndex = $channel;
}
......
......@@ -2,7 +2,7 @@
#
# EMULAB-LGPL
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -835,25 +835,43 @@ sub setVlanOnTrunks($$$;@) {
warn "ERROR - Bad device $src found in setVlanOnTrunks!\n";
$errors++;
} else {
my $found = 0;
#
# On ciscos, we can use any port in the trunk, so we'll use the
# first
#
my $modport = $trunks{$src}{$dst}[0];
$errors += !($self->{DEVICES}{$src}->setVlansOnTrunk($modport,
$value,$vlan_number));
foreach my $modport (@{ $trunks{$src}{$dst} }) {
if ($self->{DEVICES}{$src}->
setVlansOnTrunk($modport,$value,$vlan_number)) {
$found = 1;
last;
}
}
if (!$found) {
$errors += 1;
}
}
if (!$self->{DEVICES}{$dst}) {
warn "ERROR - Bad device $dst found in setVlanOnTrunks!\n";
$errors++;
} else {
my $found = 0;
#
# On ciscos, we can use any port in the trunk, so we'll use the
# first
#
my $modport = $trunks{$dst}{$src}[0];
$errors += !($self->{DEVICES}{$dst}->setVlansOnTrunk($modport,
$value,$vlan_number));
foreach my $modport (@{ $trunks{$dst}{$src} }) {
if ($self->{DEVICES}{$dst}->
setVlansOnTrunk($modport,$value,$vlan_number)) {
$found = 1;
last;
}
}
if (!$found) {
$errors += 1;
}
}
}
......
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