aboutsummaryrefslogtreecommitdiff
path: root/net/mwan3
diff options
context:
space:
mode:
authorAaron Goodman <aaronjg@stanford.edu>2020-10-29 23:06:25 -0400
committerAaron Goodman <aaronjg@stanford.edu>2020-10-29 23:06:25 -0400
commit13d22445e4021ca66c79914efef86a9c711b4ca5 (patch)
tree3510fccff7795d4f56fa612c90150e0deda547e0 /net/mwan3
parentf1bfda4c373ff9c0fc964249c9536da849f7386d (diff)
mwan3: fix rpcd with for routers with no IPv6 support
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
Diffstat (limited to 'net/mwan3')
-rw-r--r--net/mwan3/files/lib/mwan3/common.sh3
-rw-r--r--net/mwan3/files/lib/mwan3/mwan3.sh3
-rwxr-xr-xnet/mwan3/files/usr/libexec/rpcd/mwan34
3 files changed, 5 insertions, 5 deletions
diff --git a/net/mwan3/files/lib/mwan3/common.sh b/net/mwan3/files/lib/mwan3/common.sh
index daa4b2abc..5c9b2a805 100644
--- a/net/mwan3/files/lib/mwan3/common.sh
+++ b/net/mwan3/files/lib/mwan3/common.sh
@@ -23,6 +23,9 @@ MMX_UNREACHABLE=""
MM_UNREACHABLE=""
MAX_SLEEP=$(((1<<31)-1))
+command -v ip6tables > /dev/null
+NO_IPV6=$?
+
LOG()
{
local facility=$1; shift
diff --git a/net/mwan3/files/lib/mwan3/mwan3.sh b/net/mwan3/files/lib/mwan3/mwan3.sh
index 2a689c0c8..e6e43ebe8 100644
--- a/net/mwan3/files/lib/mwan3/mwan3.sh
+++ b/net/mwan3/files/lib/mwan3/mwan3.sh
@@ -24,9 +24,6 @@ IPv4_REGEX="((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[0
DEFAULT_LOWEST_METRIC=256
-command -v ip6tables > /dev/null
-NO_IPV6=$?
-
mwan3_push_update()
{
# helper function to build an update string to pass on to
diff --git a/net/mwan3/files/usr/libexec/rpcd/mwan3 b/net/mwan3/files/usr/libexec/rpcd/mwan3
index 76f557e9f..a97b33d5c 100755
--- a/net/mwan3/files/usr/libexec/rpcd/mwan3
+++ b/net/mwan3/files/usr/libexec/rpcd/mwan3
@@ -5,8 +5,6 @@
. /usr/share/libubox/jshn.sh
. /lib/mwan3/common.sh
-MWAN3TRACK_STATUS_DIR="/var/run/mwan3track"
-
IPS="ipset"
IPT4="iptables -t mangle -w"
IPT6="ip6tables -t mangle -w"
@@ -22,6 +20,7 @@ report_connected_v4() {
}
report_connected_v6() {
+ [ $NO_IPV6 -ne 0 ] && return
local address
if [ -n "$($IPT6 -S mwan3_connected 2> /dev/null)" ]; then
@@ -60,6 +59,7 @@ report_policies_v4() {
}
report_policies_v6() {
+ [ $NO_IPV6 -ne 0 ] && return
local policy
for policy in $($IPT6 -S | awk '{print $2}' | grep mwan3_policy_ | sort -u); do