Merge branch 'hotfix-1.1.1'

This commit is contained in:
Conrad Lara - KG6JEI 2014-07-09 16:24:00 -07:00
commit 852ea4c3f6
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 "\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 "$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};
open(ETHER, ">/etc/ethers") or die;

View File

@ -417,9 +417,19 @@ sub get_ip6_addr
sub get_default_gw
{
my $gw = "none";
foreach(`route -n`)
# Table 31 is populated by OLSR
foreach(`/usr/sbin/ip route list table 31`)
{
next unless /^0\.0\.0\.0\s+([\d\.]+)/;
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;
}