From 506b15286b6065a0677472780abfa02cb1ba3791 Mon Sep 17 00:00:00 2001 From: dman776 Date: Wed, 11 Jul 2018 22:51:22 -0500 Subject: [PATCH] bugfix: node cannot detect that it was WAN access. location if 'ip' command is incorrect (fixes #40) (#41) --- files/www/cgi-bin/perlfunc.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/files/www/cgi-bin/perlfunc.pm b/files/www/cgi-bin/perlfunc.pm index 7fc0ca55..bc059f52 100644 --- a/files/www/cgi-bin/perlfunc.pm +++ b/files/www/cgi-bin/perlfunc.pm @@ -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; }