Commit 66640877 authored by Robert Ricci's avatar Robert Ricci

Hack: Don't worry about the number of interfaces on LAN nodes, since

not all nodes have to be on the same switch.
parent ebfdfbf7
......@@ -632,26 +632,32 @@ int mapping_precheck() {
}
}
// Check link types
tb_vnode::link_counts_map::iterator vit;
for (vit = v->link_counts.begin(); vit != v->link_counts.end();
vit++) {
fstring type = vit->first;
int count = vit->second;
if (pnode->link_counts.find(type) !=
pnode->link_counts.end()) {
// Found at least one link of this type
matched_links[type] = true;
if (pnode->link_counts[type] >= count) {
// Great, there are enough, too
matched_link_counts[type]++;
} else {
potential_match = false;
}
} else {
potential_match = false;
}
}
// Check link types - right now, we treat LANs specially, which
// I am not happy about, but it seems to be necessary.
// Otherwise, we can get a false negative when there are few
// ports on a switch available, but we could map by using
// the trunk links
if (this_type != "lan") {
tb_vnode::link_counts_map::iterator vit;
for (vit = v->link_counts.begin(); vit != v->link_counts.end();
vit++) {
fstring type = vit->first;
int count = vit->second;
if (pnode->link_counts.find(type) !=
pnode->link_counts.end()) {
// Found at least one link of this type
matched_links[type] = true;
if (pnode->link_counts[type] >= count) {
// Great, there are enough, too
matched_link_counts[type]++;
} else {
potential_match = false;
}
} else {
potential_match = false;
}
}
}
if (potential_match) {
vec->push_back(*it);
......
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