diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index d3ae4ef7d..24ed57859 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -268,6 +268,11 @@ function get_ip(interface) return ip end +function get_device(interface) + local dump = require("luci.util").ubus("network.interface.%s" % interface, "status", {}) + return dump['l3_device'] +end + function get_gateway(interface) local gateway = "" local dump = nil @@ -332,6 +337,9 @@ function interfaces_status() mArray.openmptcprouter["tun_service"] = true mArray.openmptcprouter["tun_ip"] = get_ip("omrvpn") local tun_dev = uci:get("network","omrvpn","ifname") + if tun_dev == "" then + tun_dev = get_device("omrvpn") + end if tun_dev ~= "" then local peer = get_gateway("omrvpn") if peer == "" then @@ -418,6 +426,9 @@ function interfaces_status() --if interface == "lo" then return end local ifname = section['ifname'] or "" + if ifname == "" then + ifname = get_device(interface) + end --if multipath == "off" and not ifname:match("^tun.*") then return end if multipath == "off" then return end diff --git a/mptcp/files/etc/init.d/mptcp b/mptcp/files/etc/init.d/mptcp index 3f82dab2a..9d7ed0473 100755 --- a/mptcp/files/etc/init.d/mptcp +++ b/mptcp/files/etc/init.d/mptcp @@ -38,6 +38,7 @@ interface_multipath_settings() { local intf="$2" config_get iface "$config" ifname + [ -z "$iface"] && iface=$(ifstatus "$config" | jsonfilter -e '@["l3_device"]') count=$(($count+1)) id=$count [ -n "$intf" ] && [ "$iface" != "$intf" ] && return 0 diff --git a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking index 5e9b0d296..f2bcc68fa 100755 --- a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking +++ b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking @@ -7,6 +7,7 @@ set_route() { PREVINTERFACE=$2 multipath_config=$(uci -q get network.$INTERFACE.multipath || echo "off") interface_if=$(uci -q get network.$INTERFACE.ifname) + [ -z "$interface_if" ] && interface_if=$(ifstatus "$INTERFACE" | jsonfilter -e '@["l3_device"]') multipath_current_config=$(multipath $interface_if | grep deactivated) if [ "$multipath_config" != "off" ] && [ "$SETROUTE" != true ] && [ "$INTERFACE" != "$PREVINTERFACE" ] && [ "$multipath_current_config" = "" ]; then #if [ "$multipath_config" != "off" ] && [ "$SETROUTE" != true ]; then diff --git a/omr-tracker/files/etc/init.d/omr-tracker b/omr-tracker/files/etc/init.d/omr-tracker index bbb4a572a..efe216266 100755 --- a/omr-tracker/files/etc/init.d/omr-tracker +++ b/omr-tracker/files/etc/init.d/omr-tracker @@ -42,6 +42,7 @@ _launch_tracker() { local ifname ip4table config_get ifname "$1" ifname + [ -z "$ifname" ] && ifname=$(ifstatus "$1" | jsonfilter -e '@["l3_device"]') config_get multipath "$1" multipath config_get gateway "$1" gateway