mirror of https://github.com/aredn/aredn.git
bugfix: node cannot detect that it was WAN access. location if 'ip' command is incorrect (fixes #40) (#41)
This commit is contained in:
parent
906044ab77
commit
506b15286b
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue