Commit 45a4963a authored by Mike Hibler's avatar Mike Hibler

Aim a little more carefully when pissing on things.

Only place the last bit of the address in the reverse file, not the
entire IP address.  Still, this whole file will probably only work for
a /24 net...
parent e9f43808
......@@ -47,8 +47,11 @@ my $NAMED_FORWARDERS = "@NAMED_FORWARDERS@";
use lib "@prefix@/lib";
use libdb;
#
# This is for the dotted and reverse dotted notation needed for the
# reverse maps. This is probably all wrong ...
# XXX only right for a /24?
#
my ($ia, $ib, $ic, $id) =
($TESTBED_NETWORK =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/);
my ($ea, $eb, $ec, $ed) =
......@@ -69,11 +72,16 @@ system("cp -f reverse.head $internal_revfile") == 0 or
open(REV, ">>$internal_revfile")
or die("Unable to open $internal_revfile for appending!\n");
# XXX assumes /24
my $BOSSNODE_ADDR = $1 if ($BOSSNODE_IP =~ /\d+\.\d+\.\d+\.(\d+)/);
my $USERNODE_ADDR = $1 if ($USERNODE_IP =~ /\d+\.\d+\.\d+\.(\d+)/);
my $FSNODE_ADDR = $1 if ($FSNODE_IP =~ /\d+\.\d+\.\d+\.(\d+)/);
print REV "\n";
print REV "${BOSSNODE_IP}\tIN\tPTR\tboss.${OURDOMAIN}.\n";
print REV "${USERNODE_IP}\tIN\tPTR\tops.${OURDOMAIN}.\n";
print REV "${BOSSNODE_ADDR}\tIN\tPTR\tboss.${OURDOMAIN}.\n";
print REV "${USERNODE_ADDR}\tIN\tPTR\tops.${OURDOMAIN}.\n";
if ($FSNODE_IP ne $USERNODE_IP) {
print REV "${FSNODE_IP}\tIN\tPTR\tfs.${OURDOMAIN}.\n";
print REV "${FSNODE_ADDR}\tIN\tPTR\tfs.${OURDOMAIN}.\n";
}
close(REV);
......@@ -91,11 +99,16 @@ system("cp -f reverse.head $external_revfile") == 0 or
open(REV, ">>$external_revfile")
or die("Unable to open $external_revfile for appending!\n");
# XXX assumes /24
$BOSSNODE_ADDR = $1 if ($EXTERNAL_BOSSNODE_IP =~ /\d+\.\d+\.\d+\.(\d+)/);
$USERNODE_ADDR = $1 if ($EXTERNAL_USERNODE_IP =~ /\d+\.\d+\.\d+\.(\d+)/);
$FSNODE_ADDR = $1 if ($EXTERNAL_FSNODE_IP =~ /\d+\.\d+\.\d+\.(\d+)/);
print REV "\n";
print REV "${EXTERNAL_BOSSNODE_IP}\tIN\tPTR\tboss.${OURDOMAIN}.\n";
print REV "${EXTERNAL_USERNODE_IP}\tIN\tPTR\tops.${OURDOMAIN}.\n";
if ($FSNODE_IP ne $USERNODE_IP) {
print REV "${EXTERNAL_FSNODE_IP}\tIN\tPTR\tfs.${OURDOMAIN}.\n";
print REV "${BOSSNODE_ADDR}\tIN\tPTR\tboss.${OURDOMAIN}.\n";
print REV "${USERNODE_ADDR}\tIN\tPTR\tops.${OURDOMAIN}.\n";
if ($EXTERNAL_FSNODE_IP ne $EXTERNAL_USERNODE_IP) {
print REV "${FSNODE_ADDR}\tIN\tPTR\tfs.${OURDOMAIN}.\n";
}
close(REV);
......
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