bugfix: Links on status page use midX domains which are not resolveable on host they reference.

mid hostname entries are only created on remote nodes and are not created on the local node (by design of nameservice module)

In order to allow links on remote nodes olsr status screens and potentionaly other locations to resolve correctly we must add a hostname for the dtdlink interface into the name service beacons.
In addtion we need to ensure the UI looks at these links instead.

This feature will need to be looked at for long in the mesh status screen to find a better method to display these connections.

ref BBHN->ticket:47
This commit is contained in:
Conrad Lara - KG6JEI 2014-06-23 19:42:20 -07:00
parent 9fbac6c3f2
commit 25ad0fcadc
3 changed files with 19 additions and 2 deletions

View File

@ -227,6 +227,7 @@ print HOSTS "127.0.0.1\tlocalhost\n";
print HOSTS "$cfg{lan_ip}\tlocalnode ";
print HOSTS "\n$cfg{wifi_ip}\t" if $cfg{wifi_ip};
print HOSTS "$node $tactical\n";
print HOSTS "$cfg{dtdlink_ip}\tdtdlink.$node.local.mesh dtdlink.$node" if $cfg{dtdlink_ip};
print HOSTS add_ip_address($cfg{lan_ip}, 1), "\tlocalap\n" unless $cfg{dmz_mode};
open(ETHER, ">/etc/ethers") or die;

View File

@ -25,6 +25,14 @@ if(-f "/etc/config/dmz-mode")
}
}
# Add a name for the dtdlink interface.
if ($name = nvram_get("node"))
{
my ($dtdip,$dtdmask,$dtdbcast,$dtdnet);
($dtdip, $dtdmask, $dtdbcast, $dtdnet) = get_ip4_network("eth0.2");
push @hosts, qq("$dtdip" "dtdlink.$name.local.mesh");
}
# load the services
foreach(`cat /etc/config/services 2>/dev/null`)
{

View File

@ -73,7 +73,7 @@ foreach(`cat /etc/hosts`)
next unless /^10[.]/;
chomp;
($ip, $name, $tactical) = split /\s+/, $_;
next if $name =~ /^(localhost|localnode|localap)$/;
next if $name =~ /^(localhost|localnode|localap|dtdlink\..*)$/;
if($ip eq $my_ip)
{
$tactical = "" unless $tactical;
@ -94,10 +94,18 @@ foreach(`cat /var/run/hosts_olsr 2>/dev/null`)
($ip, $name, $junk, $originator, $mid, $midnum) = split /\s+/, $_;
next unless $originator;
next if $originator eq "myself";
if ( $name =~ /^dtdlink\..*$/ )
{
$hosts{$ip}{name} = $name;
next;
}
if(defined $mid and $midnum =~ /^\#(\d+)/)
{
if ( !exists $hosts{$ip}{name} )
{
$hosts{$ip}{name} = $name;
}
$hosts{$ip}{hide} = 1;
$hosts{$originator}{mid} = $1;
}