mirror of https://github.com/aredn/aredn.git
Merge branch 'hotfix-1.1.1'
This commit is contained in:
commit
852ea4c3f6
|
@ -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;
|
||||
|
|
|
@ -417,12 +417,22 @@ sub get_ip6_addr
|
|||
sub get_default_gw
|
||||
{
|
||||
my $gw = "none";
|
||||
foreach(`route -n`)
|
||||
{
|
||||
next unless /^0\.0\.0\.0\s+([\d\.]+)/;
|
||||
$gw = $1;
|
||||
last;
|
||||
}
|
||||
|
||||
# Table 31 is populated by OLSR
|
||||
foreach(`/usr/sbin/ip route list table 31`)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue