mwan3: fix regression in ipv6 routing tables

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
This commit is contained in:
Aaron Goodman 2020-12-28 20:09:08 -05:00
parent c255a9208a
commit 267b65ad9f
8 changed files with 12 additions and 21 deletions

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mwan3
PKG_VERSION:=2.10.5
PKG_VERSION:=2.10.6
PKG_RELEASE:=1
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>, \
Aaron Goodman <aaronjg@alumni.stanford.edu>

View File

@ -21,7 +21,8 @@ fi
[ "$MWAN3_STARTUP" = "init" ] || procd_lock
config_load mwan3
mwan3_init
/etc/init.d/mwan3 running || {
[ "$MWAN3_STARTUP" = "init" ] || procd_lock
LOG notice "mwan3 hotplug $ACTION on $INTERFACE not called because globally disabled"
@ -34,8 +35,6 @@ $IPT4 -S mwan3_hook &>/dev/null || {
exit 0
}
mwan3_init
if [ "$MWAN3_STARTUP" != "init" ] && [ "$ACTION" = "ifup" ]; then
mwan3_set_user_iface_rules $INTERFACE $DEVICE
fi

View File

@ -27,7 +27,6 @@ start_tracker() {
start_service() {
local enabled hotplug_pids
config_load mwan3
mwan3_init
config_foreach start_tracker interface
@ -57,7 +56,6 @@ start_service() {
stop_service() {
local ipset rule IP IPTR IPT family table tid
config_load mwan3
mwan3_init
config_foreach mwan3_interface_shutdown interface

View File

@ -107,8 +107,9 @@ mwan3_get_mwan3track_status()
mwan3_init()
{
local bitcnt
local mmdefault
local bitcnt mmdefault source_routing
config_load mwan3
[ -d $MWAN3_STATUS_DIR ] || mkdir -p $MWAN3_STATUS_DIR/iface_state
@ -117,7 +118,6 @@ mwan3_init()
MMX_MASK=$(cat "${MWAN3_STATUS_DIR}/mmx_mask")
MWAN3_INTERFACE_MAX=$(uci_get_state mwan3 globals iface_max)
else
config_load mwan3
config_get MMX_MASK globals mmx_mask '0x3F00'
echo "$MMX_MASK"| tr 'A-F' 'a-f' > "${MWAN3_STATUS_DIR}/mmx_mask"
LOG debug "Using firewall mask ${MMX_MASK}"
@ -130,7 +130,9 @@ mwan3_init()
fi
# remove "linkdown", expiry and source based routing modifiers from route lines
MWAN3_ROUTE_LINE_EXP="s/linkdown //; s/expires [0-9]\+sec//;s/error [0-9]\+//; ${source_routing:+s/default\(.*\) from [^ ]*/default\1/;} p"
config_get_bool source_routing globals source_routing 0
[ $source_routing -eq 1 ] && unset source_routing
MWAN3_ROUTE_LINE_EXP="s/linkdown //; s/expires [0-9]\+sec//; s/error [0-9]\+//; ${source_routing:+s/default\(.*\) from [^ ]*/default\1/;} p"
# mark mask constants
bitcnt=$(mwan3_count_one_bits MMX_MASK)

View File

@ -410,9 +410,6 @@ mwan3_delete_iface_iptables()
mwan3_get_routes()
{
local source_routing
config_get_bool source_routing globals source_routing 0
[ $source_routing -eq 0 ] && unset source_routing
$IP route list table main | sed -ne "$MWAN3_ROUTE_LINE_EXP" | uniq
}

View File

@ -129,7 +129,6 @@ use() {
local interface device src_ip family
mwan3_init
config_load mwan3
interface=$1 ; shift
[ -z "$*" ] && echo "no command specified for mwan3 use" && return

View File

@ -69,14 +69,11 @@ mwan3_add_all_routes()
mwan3_rtmon_route_handle()
{
local action route_line family tbl device line tid source_routing
local action route_line family tbl device line tid
route_line=${1##"Deleted "}
route_family=$2
config_get_bool source_routing globals source_routing 0
[ $source_routing -eq 0 ] && unset source_routing
if [ "$route_line" = "$1" ]; then
action="replace"
$IPS -! add mwan3_connected_${route_family##ip} ${route_line%% *}
@ -143,7 +140,8 @@ main()
{
local IP family
config_load mwan3
mwan3_init
family=$1
[ -z $family ] && family=ipv4
if [ "$family" = "ipv6" ]; then
@ -155,7 +153,6 @@ main()
else
IP="$IP4"
fi
mwan3_init
sh -c "echo \$\$; exec $IP monitor route" | {
read -r monitor_pid
trap_with_arg func_trap "$monitor_pid" SIGINT SIGTERM SIGKILL

View File

@ -192,7 +192,6 @@ main() {
trap if_down USR1
trap if_up USR2
config_load mwan3
config_get FAMILY $INTERFACE family ipv4
config_get track_method $INTERFACE track_method ping
config_get_bool httping_ssl $INTERFACE httping_ssl 0