Commit 17c47eb3 authored by Leigh Stoller's avatar Leigh Stoller

Fix GetJailIP() which is only used when ops is a jail on boss.

parent 7ec685f9
......@@ -3833,24 +3833,14 @@ sub GetJailIP($;$)
}
}
my $node_id = $self->node_id();
my $query_result =
DBQueryWarn( "SELECT IP, mask FROM virt_node_public_addr WHERE " .
"node_id='$node_id'" );
if( $query_result && $query_result->numrows ) {
# we've assigned a public address to this one
return $query_result->fetchrow_array();
} else {
my $nodenumlimit = $ISUTAH ? 200 : 254;
my $pnet = $IPBASE2;
my $pnode2 = int($ipbase);
while ($pnode2 > $nodenumlimit) {
$pnet++;
$pnode2 -= $nodenumlimit;
}
return ("${IPBASE1}.${pnet}.${pnode2}.${num}", $JAILIPMASK);
}
my $nodenumlimit = $ISUTAH ? 200 : 254;
my $pnet = $IPBASE2;
my $pnode2 = int($ipbase);
while ($pnode2 > $nodenumlimit) {
$pnet++;
$pnode2 -= $nodenumlimit;
}
return ("${IPBASE1}.${pnet}.${pnode2}.${num}", $JAILIPMASK);
}
#
......
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