Merge branch 'hotfix-1.1.1' into develop

This commit is contained in:
Conrad Lara - KG6JEI 2014-07-09 16:25:58 -07:00
commit e806a89e45
2 changed files with 17 additions and 7 deletions

View File

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

View File

@ -417,12 +417,22 @@ sub get_ip6_addr
sub get_default_gw sub get_default_gw
{ {
my $gw = "none"; my $gw = "none";
foreach(`route -n`)
{ # Table 31 is populated by OLSR
next unless /^0\.0\.0\.0\s+([\d\.]+)/; foreach(`/usr/sbin/ip route list table 31`)
$gw = $1; {
last; next unless /^default\svia\s([\d\.]+)/;
} $gw = $1;
last;
}
# However a node with a wired default gw will route via that instead
foreach(`/usr/sbin/ip route list table 254`)
{
next unless /^default\svia\s([\d\.]+)/;
$gw = $1;
last;
}
return $gw; return $gw;
} }