Commit 8e236ecc authored by Shashi Guruprasad's avatar Shashi Guruprasad
Browse files

Fixes the bug unearthed by Tim. When a link is created between a jail

vnode and a PC node, under normal circumstances, a real physical link
is used. However, a user can use tb-set-multiplexed on the link that
allows assign to map multiple vlinks over the same physical link.
This is fine when the PC is running FBSD-STD which can use veth
interfaces. Not so if it is running Linux or a non-standard BSD.
This fix forces EMULATED links and VETH devices when the PC is running
FBSD-STD and turns those attributes off otherwise so that assign
will not give a mapping that cannot be realized on the client side.
For the gory details of this problem, look at testbed-ops email thread
"pcvm route problem" dated 29th Jan 2004.

A problem still exists in the non-BSD router + jail vnodes in a delayed
LAN. VLANs table is not getting the correct entries. A fix will come
soon. Follow the testbed-ops email thread "fix for the pcvm route problem"
dated 29th Jan 2004 for the gory details.
parent 9ca0b4ce
......@@ -3359,6 +3359,7 @@ sub CreateTopFile()
my $realnodes = 0;
my $virtnodes = 0;
my $nonvirtnodes = 0;
my $nonbsdnodes = 0;
my $trivial_ok = 0;
my $emulated = virtlanemulated($lan);
my $uselinkdelay = virtlanlinkdelay($lan);
......@@ -3373,24 +3374,59 @@ sub CreateTopFile()
$virtnodes++;
} else {
$nonvirtnodes++;
# We check against the standard FBSD and declare the node
# to be a nonbsd one even if it is actually running FBSD
# via a user-specific FBSD image. Thats coz there is no
# way of determining if the FBSD image is actually running
# our kernel that can do veths
if (virtnodeosid($node) ne TBOSID(TB_OPSPID, "FBSD-STD")) {
$nonbsdnodes++;
}
}
$realnodes++;
}
}
if ($virtnodes > 0 && $nonvirtnodes == 0) {
# We use an emulated link if all members of the lan are
# virtnodes. An emulated link can use a trivial link
# too, if the user wanted it.
$emulated = 1;
$virt_lans{$lan}->{"EMULATED"} = 1;
if ($virtnodes > 0) {
$trivial_ok = virtlantrivok($lan);
#
# An emulated link/lan between containing any
# virtnodes always uses veth devices. Note that remote
# virtual nodes never go through this path cause they
# get tunnels, so its only local virtual nodes.
#
$virt_lans{$lan}->{"USEVETH"} = 1;
if ($nonvirtnodes == 0 || $nonbsdnodes == 0) {
# We use an emulated link if all members of the lan are
# virtnodes. An emulated link can use a trivial link
# too, if the user wanted it.
$emulated = 1;
$virt_lans{$lan}->{"EMULATED"} = 1;
#
# An emulated link/lan between containing any
# virtnodes always uses veth devices. Note that remote
# virtual nodes never go through this path cause they
# get tunnels, so its only local virtual nodes.
#
$virt_lans{$lan}->{"USEVETH"} = 1;
} else {
# We don't support EMULATED/USEVETH for lans/links that
# have non-bsd nodes (nodes running Linux or a non
# standard BSD). This means we'll turn off these
# options even if the user explicitly asked for them
# If the user had explicitly asked for these, we
# print a warning
if (virtlanemulated($lan)) {
print STDERR "*** WARNING: $0: ".
"tb-set-multiplexed not supported on ".
"$lan since one of the nodes in $lan is ".
"not running the standard FreeBSD image ".
"(FBSD-STD)\n";
}
if (virtlanuseveth($lan)) {
print STDERR "*** WARNING: $0: ".
"tb-set-useveth not supported on ".
"$lan since one of the nodes in $lan is ".
"not running the standard FreeBSD image ".
"(FBSD-STD)\n";
}
$emulated = 0;
$virt_lans{$lan}->{"EMULATED"} = 0;
$virt_lans{$lan}->{"USEVETH"} = 0;
}
}
#
# If all nodes in a lan/link are simulated, the lan/link could certainly
......
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