Commit d9e67f51 authored by Leigh Stoller's avatar Leigh Stoller

Lans that vlans can now be a mix of real ports and vinterfaces, have

to make sure that the vinterfaces do not go into the vlans members list
or else snmpit is very unhappy.
parent 278043d0
......@@ -2776,10 +2776,23 @@ sub PortList($$)
foreach my $member (@members) {
my $nodeid;
my $iface;
my $trivial;
return -1
if ($member->GetAttribute("node_id", \$nodeid) != 0 ||
$member->GetAttribute("iface", \$iface) != 0);
#
# A lan that is a mix of real ports and trivial ports, is type vlan
# (so it gets built on the switches), but will include those
# trivial ports in the member list, but they need to be ignored
# when operating on it as a vlan. libvtop sets this attribute when
# it happens, and we watch for it here, pruning out those trivial
# interfaces. A better way might be to remove them completely in
# libvtop, but thats a bigger change with more side effects.
#
next
if ($member->GetAttribute("trivial", \$trivial) == 0);
push(@ports, "$nodeid:$iface");
}
......
......@@ -6754,10 +6754,6 @@ sub InterpLinksAux($)
(defined($protovlan) ?
undef : $portA));
# For below.
$portA = $virtiface->viface()
if (defined($virtiface));
#
# If the "lannode" is placed on a node, and that node is
# different than the current node, we have to connect the
......@@ -6779,6 +6775,10 @@ sub InterpLinksAux($)
$member0->_lannode(),
$member0->_lanport());
}
# For below.
$portA = $virtiface->viface()
if (defined($virtiface));
}
else {
$protolan = ProtoLan->Lookup($experiment, $lan);
......@@ -6855,7 +6855,17 @@ sub InterpLinksAux($)
$protolan->SetType("trivial");
$protolan->SetRole("link/lan");
}
$protolan->AddInterface($nodeA, $vnodeA, $vportA, $portA);
#
# A lan can be a mix of real and trivial members, say if
# its a lan of multiple members that spans two physical
# nodes with multiple members on each node. In this case,
# we have to mark these interfaces in the lans table to
# make it easy for snmpit to ignore them when setting up
# the physical part of the lan, and just use the physical
# interfaces that were added above.
#
$protolan->AddInterface($nodeA, $vnodeA, $vportA, $portA,
undef, {"trivial" => "yes"});
}
else {
# next plink
......
......@@ -361,12 +361,25 @@ sub getVlanPorts (@) {
my $nodeid;
my $iface;
my $port;
my $trivial;
if ($member->GetAttribute("node_id", \$nodeid) != 0 ||
$member->GetAttribute("iface", \$iface) != 0) {
die("*** $0:\n".
" Missing attributes for $member in $vlan\n");
}
#
# A lan that is a mix of real ports and trivial ports, is type vlan
# (so it gets built on the switches), but will include those
# trivial ports in the member list, but they need to be ignored
# when operating on it as a vlan. libvtop sets this attribute when
# it happens, and we watch for it here, pruning out those trivial
# interfaces. A better way might be to remove them completely in
# libvtop, but thats a bigger change with more side effects.
#
next
if ($member->GetAttribute("trivial", \$trivial) == 0);
$port = Port->LookupByIface($nodeid, $iface);
#
# Ports can be undef -- i.e., if this is a layer 2 path implemented
......@@ -1171,6 +1184,8 @@ sub getDeviceOptions($) {
if ($debug) {
print "Options for $switch:\n";
while (my ($key,$value) = each %options) {
$value = "undef"
if (!defined($value));
print "$key = $value\n"
}
}
......
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