bugfix: node cannot detect that it was WAN access. location if 'ip' command is incorrect (fixes #40) (#41)

This commit is contained in:
dman776 2018-07-11 22:51:22 -05:00 committed by GitHub
parent 906044ab77
commit 506b15286b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions

View File

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