Commit d8c68764 authored by Robert Ricci's avatar Robert Ricci
Browse files

Changed the rules in swapok() - we need to make sure that neither port

is a control interface. This can occur if you swap an experiment out, and
swap it back in on a different hardware type.
parent e3215959
......@@ -987,6 +987,19 @@ sub swapok {
my ($Btype) = $result->fetchrow_array;
$result->finish;
return ($interfacespeed{$Atype} == $interfacespeed{$Btype});
if ($interfacespeed{$Atype} != $interfacespeed{$Btype}) {
return 0;
}
# It is illegal to swap ports if either is a control interface
$result = DBQueryFatal("SELECT control_iface FROM nodes" .
" LEFT JOIN node_types ON " .
" nodes.type = node_types.type " .
" WHERE node_id=\"$pnode\"");
my ($control_iface) = $result->fetchrow_array;
$result->finish;
return (($portA != $control_iface) && ($portB != $control_iface));
};
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