Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
1a54e61d
Commit
1a54e61d
authored
Aug 22, 2003
by
Leigh B. Stoller
Browse files
Fixes to keep subnodes and their unroutable IPs out of the
main zone file (which were also being inserted with bad syntax).
parent
cdc6da0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/named_setup.in
View file @
1a54e61d
...
...
@@ -150,8 +150,8 @@ my $db_result =
"
left join node_types as nt on n.type=nt.type
"
.
"
left join interfaces as i on n.node_id=i.node_id and
"
.
"
nt.control_net=i.card
"
.
"
where nt.isvirtnode=0 and n
.role='test
node
'
and
"
.
"
i.IP is not null
"
.
"
where nt.isvirtnode=0 and n
t.issub
node
=0
and
"
.
"
n.role='testnode' and
i.IP is not null
"
.
"
order by nt.type,n.node_id
");
my
%reverse
;
...
...
@@ -201,7 +201,9 @@ print MAP "\$TTL\t1\n\n";
$db_result
=
DBQueryFatal
("
select r.node_id,pid,eid,vname,n.phys_nodeid,n.jailip
"
.
"
from reserved as r
"
.
"
left join nodes as n on n.node_id=r.node_id
");
"
left join nodes as n on n.node_id=r.node_id
"
.
"
left join node_types as nt on nt.type=n.type
"
.
"
where nt.issubnode=0
");
if
(
$db_result
->
numrows
>
0
)
{
#
...
...
@@ -288,7 +290,7 @@ $db_result =
"
left join nodes as n on n.node_id=r.node_id
"
.
"
left join node_types as nt on nt.type=n.type
"
.
"
where nt.isvirtnode=1 and nt.isremotenode=0 and
"
.
"
n.jailip is not null
");
"
nt.issubnode=0 and
n.jailip is not null
");
if
(
$db_result
->
numrows
>
0
)
{
#
...
...
@@ -313,6 +315,49 @@ if ($db_result->numrows > 0) {
printf
MAP
"
$cname
IN
\t
CNAME
\t
$node_id
\n
";
}
}
#
# Other unroutable addresses.
#
print
MAP
"
;
\n
"
.
"
; Other unroutable IPs (allocated subnodes only).
\n
"
.
"
;
\n
";
$db_result
=
DBQueryFatal
("
select r.node_id,r.pid,r.eid,r.vname,i.IP
"
.
"
from reserved as r
"
.
"
left join nodes as n on r.node_id=n.node_id
"
.
"
left join node_types as nt on n.type=nt.type
"
.
"
left join interfaces as i on n.node_id=i.node_id and
"
.
"
nt.control_net=i.card
"
.
"
where nt.issubnode=1 and
"
.
"
n.role='testnode' and i.IP is not null
"
.
"
order by nt.type,n.node_id
");
if
(
$db_result
->
numrows
>
0
)
{
#
# Create a CNAME for each reserved node.
#
while
(
my
%row
=
$db_result
->
fetchhash
)
{
my
$node_id
=
$row
{"
node_id
"};
my
$pid
=
$row
{"
pid
"};
my
$eid
=
$row
{"
eid
"};
my
$IP
=
$row
{"
IP
"};
my
$vname
=
$node_id
;
if
(
defined
(
$row
{"
vname
"}))
{
$vname
=
$row
{"
vname
"};
}
# Spit an A record for the node.
print
MAP
"
$node_id
\t
IN
\t
A
\t
$IP
\n
";
# Then a CNAME.
my
$cname
=
sprintf
("
%-40s
",
"
$vname
.
$eid
.
$pid
");
printf
MAP
"
$cname
IN
\t
CNAME
\t
$node_id
\n
";
}
}
close
(
MAP
);
#
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment