diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml old mode 100755 new mode 100644 index 6658b8dde..e783cb0a8 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,13 +3,13 @@ on: [push] env: REPO_URL: 'https://github.com/suyuan168/3grouter' - OMR_KERNEL: '5.4' jobs: build: strategy: matrix: - OMR_TARGET: [bpi-r1, bpi-r2, bpi-r64, rpi2, rpi4, wrt32x, espressobin, r2s, rpi3, wrt3200acm, x86, x86_64, ubnt-erx, r4s] + OMR_TARGET: [bpi-r1, bpi-r2, bpi-r64, rpi2, rpi4, wrt32x, espressobin, r2s, rpi3, wrt3200acm, x86, x86_64, ubnt-erx, r4s, r7800, l1000, zbt4019] + OMR_KERNEL: [5.4, 5.14] runs-on: ubuntu-latest continue-on-error: true @@ -61,10 +61,11 @@ jobs: OMR_FEED_URL: https://github.com/suyuan168/openmptcprouter-feeds SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }} OMR_TARGET: ${{ matrix.OMR_TARGET }} + OMR_KERNEL: ${{ matrix.OMR_KERNEL }} OMR_HOST: ${{ secrets.OMR_HOST }} OMR_PORT: ${{ secrets.OMR_PORT }} run: | - OMR_FEED_SRC="${SOURCE_NAME}" sh build.sh prepare {tools,toolchain}/install -j$(nproc) || OMR_FEED_SRC="${SOURCE_NAME}" sh build.sh prepare {tools,toolchain}/install -j1 V=s + OMR_KERNEL="${OMR_KERNEL}" OMR_FEED_SRC="${SOURCE_NAME}" sh build.sh prepare {tools,toolchain}/install -j$(nproc) || OMR_KERNEL="${OMR_KERNEL}" OMR_FEED_SRC="${SOURCE_NAME}" sh build.sh prepare {tools,toolchain}/install -j1 V=s #echo -e "${{ secrets.OMR_PRIVKEY }}" > $OMR_TARGET/source/key-build #echo -e "${{ secrets.OMR_PUBKEY }}" > $OMR_TARGET/source/key-build.pub - name: Build packages @@ -108,7 +109,7 @@ jobs: SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} with: command: | - mkdir -p /www/wwwroot/55860.com/bak/down/${{env.SOURCE_BRANCH}}/${{env.OMR_KERNEL}}/${{matrix.OMR_TARGET}} + mkdir -p /www/wwwroot/55860.com/bak/down/${{env.SOURCE_BRANCH}}/${{matrix.OMR_KERNEL}}/${{matrix.OMR_TARGET}} host: ${{ secrets.OMR_DEPLOY_HOST }} user: root port: ${{ secrets.OMR_DEPLOY_PORT }} @@ -141,7 +142,7 @@ jobs: uses: ysurac/action-rsync@master env: ARGS: -av --delete-after - TARGET: /www/wwwroot/55860.com/bak/down/${{ steps.branch_name.outputs.SOURCE_BRANCH }}/${{env.OMR_KERNEL}}/${{matrix.OMR_TARGET}} + TARGET: /www/wwwroot/55860.com/bak/down/${{ steps.branch_name.outputs.SOURCE_BRANCH }}/${{matrix.OMR_KERNEL}}/${{matrix.OMR_TARGET}} SOURCE: ./bin/ KEY: ${{ secrets.PRIVATE_KEY }} USER: root @@ -151,3 +152,4 @@ jobs: SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }} SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} GITHUB_WORKSPACE: ${{ steps.branch_name.outputs.WORKSPACE }} + diff --git a/cryptodev-linux/Makefile b/cryptodev-linux/Makefile new file mode 100644 index 000000000..0c1f63a60 --- /dev/null +++ b/cryptodev-linux/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id$ + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=cryptodev-linux +PKG_VERSION:=1.12 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://codeload.github.com/$(PKG_NAME)/$(PKG_NAME)/tar.gz/$(PKG_NAME)-$(PKG_VERSION)? +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_HASH:=f51c2254749233b1b1d7ec9445158bd709f124f88e1c650fe2faac83c3a81938 +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING + +PKG_MAINTAINER:=Ansuel Smith + +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/cryptodev + SUBMENU:=Cryptographic API modules + TITLE:=Driver for cryptographic acceleration + URL:=http://cryptodev-linux.org/ + VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE) + DEPENDS:=+kmod-crypto-authenc +kmod-crypto-hash + FILES:=$(PKG_BUILD_DIR)/cryptodev.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,50,cryptodev) + MODPARAMS.cryptodev:=cryptodev_verbosity=-1 +endef + +define KernelPackage/cryptodev/description + This is a driver for that allows to use the Linux kernel supported + hardware ciphers by user-space applications. +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(KERNEL_MAKE_FLAGS) \ + KERNEL_DIR="$(LINUX_DIR)" +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR)/usr/include/crypto + $(CP) $(PKG_BUILD_DIR)/crypto/cryptodev.h $(STAGING_DIR)/usr/include/crypto/ +endef + +$(eval $(call KernelPackage,cryptodev)) diff --git a/dsvpn/files/init b/dsvpn/files/init index 1d78ed4be..ca25fd3f0 100755 --- a/dsvpn/files/init +++ b/dsvpn/files/init @@ -29,6 +29,16 @@ validate_section() { 'externalip:string:auto' } +version_over_5_4() { + MAJOR_VERSION=$(uname -r | awk -F '.' '{print $1}') + MINOR_VERSION=$(uname -r | awk -F '.' '{print $2}') + if [ $MAJOR_VERSION -ge 5 ] && [ $MINOR_VERSION -gt 13 ] || [ $MAJOR_VERSION -gt 5 ] ; then + return 0 + else + return 1 + fi +} + start_instance() { local enable key host port dev @@ -58,6 +68,10 @@ start_instance() { _log "starting ${PROG_NAME} ${1} instance $*" + if version_over_5_4; then + PROG="mptcpize run ${PROG}" + fi + procd_open_instance procd_set_param command ${PROG} ${mode} \ diff --git a/glorytun/Makefile b/glorytun/Makefile index 6cd00b7ae..95d7ed3aa 100755 --- a/glorytun/Makefile +++ b/glorytun/Makefile @@ -9,11 +9,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=glorytun -PKG_VERSION:=0.0.35 PKG_RELEASE:=6 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=6d58536f4232fea8eaa10fb60aace8ba11f29ed6 PKG_SOURCE:=glorytun-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/angt/glorytun/releases/download/v$(PKG_VERSION) -PKG_HASH:=49e4d8ea4ff2990300b37947b0bd0da3c8e0985bc6eddf29f4146306188fff64 +PKG_SOURCE_URL:=https://github.com/Ysurac/glorytun.git +PKG_VERSION:=0.0.35-$(PKG_SOURCE_VERSION) + +PKG_FIXUP:=autoreconf include $(INCLUDE_DIR)/package.mk diff --git a/glorytun/glorytun.config b/glorytun/glorytun.config index 33c93f36f..78f97090c 100755 --- a/glorytun/glorytun.config +++ b/glorytun/glorytun.config @@ -11,4 +11,5 @@ config glorytun 'vpn' option localip '10.255.255.2' option remoteip '10.255.255.1' option multiqueue '1' - option label 'Default VPN' \ No newline at end of file + option label 'Default VPN' + option timeout '10000' \ No newline at end of file diff --git a/iperf3/Makefile b/iperf3/Makefile index 1d0d891ef..6cdb6b8a9 100644 --- a/iperf3/Makefile +++ b/iperf3/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf PKG_VERSION:=3.10.1 -PKG_RELEASE:=1 +PKG_RELEASE:=10 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.es.net/pub/iperf diff --git a/iperf3/patches/remove-in6_flowlabel_req.patch b/iperf3/patches/remove-in6_flowlabel_req.patch index 3d2be694f..539f9c3c8 100644 --- a/iperf3/patches/remove-in6_flowlabel_req.patch +++ b/iperf3/patches/remove-in6_flowlabel_req.patch @@ -1,24 +1,25 @@ --- a/src/flowlabel.h 2021-06-24 13:26:33.142463630 +0200 +++ b/src/flowlabel.h 2021-06-24 13:27:45.669235179 +0200 -@@ -37,21 +37,6 @@ +@@ -37,21 +37,21 @@ conflicts with "netinet/in.h" . */ -#ifndef __ANDROID__ --struct in6_flowlabel_req --{ -- struct in6_addr flr_dst; -- __u32 flr_label; -- __u8 flr_action; -- __u8 flr_share; -- __u16 flr_flags; -- __u16 flr_expires; -- __u16 flr_linger; -- __u32 __flr_pad; -- /* Options in format of IPV6_PKTOPTIONS */ --}; --#endif -- ++#ifndef _LINUX_IN6_H + struct in6_flowlabel_req + { + struct in6_addr flr_dst; + __u32 flr_label; + __u8 flr_action; + __u8 flr_share; + __u16 flr_flags; + __u16 flr_expires; + __u16 flr_linger; + __u32 __flr_pad; + /* Options in format of IPV6_PKTOPTIONS */ + }; + #endif + #define IPV6_FL_A_GET 0 #define IPV6_FL_A_PUT 1 #define IPV6_FL_A_RENEW 2 diff --git a/libmbim/Makefile b/libmbim/Makefile index b9563219e..32c8ef493 100644 --- a/libmbim/Makefile +++ b/libmbim/Makefile @@ -1,24 +1,22 @@ # # Copyright (C) 2016 Velocloud Inc. # Copyright (C) 2016 Aleksander Morgado -# Copyright (C) 2021 Ycarus (Yannick Chabanois) for OpenMPTCProuter # # This is free software, licensed under the GNU General Public License v2. # include $(TOPDIR)/rules.mk -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libmbim.git -PKG_SOURCE_VERSION:=c90c7c5b877de6e413b4833aaf1a42d2d128b051 - PKG_NAME:=libmbim -PKG_VERSION:=1.25.3-$(PKG_SOURCE_VERSION) -PKG_RELEASE:=10 +PKG_VERSION:=1.26.0 +PKG_RELEASE:=$(AUTORELEASE) -PKG_MAINTAINER:=Nicholas Smith +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://www.freedesktop.org/software/libmbim +PKG_HASH:=1e1f0926b22c77210442129eca689722ecf324ab9c9abf421a5c989f46e813cf + +PKG_MAINTAINER:=Nicholas Smith -PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 diff --git a/libqmi/Makefile b/libqmi/Makefile index a10ea0121..a17181959 100644 --- a/libqmi/Makefile +++ b/libqmi/Makefile @@ -1,22 +1,21 @@ # # Copyright (C) 2016 Velocloud Inc. # Copyright (C) 2016 Aleksander Morgado -# Copyright (C) 2021 Ycarus (Yannick Chabanois) for OpenMPTCProuter # # This is free software, licensed under the GNU General Public License v2. # include $(TOPDIR)/rules.mk -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libqmi.git -PKG_SOURCE_VERSION:=29fab8a1d4496ca5a1d32bb486013b1868a718ba PKG_NAME:=libqmi -PKG_VERSION:=1.29.3-$(PKG_SOURCE_VERSION) -PKG_RELEASE:=10 +PKG_VERSION:=1.30.2 +PKG_RELEASE:=$(AUTORELEASE) -PKG_FIXUP:=autoreconf -PKG_MAINTAINER:=Nicholas Smith +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://www.freedesktop.org/software/libqmi +PKG_HASH:=be01ece0ea2c2194cbea5744bf5aaf06c04ba5fb7ec7887a13116c76d114fedd + +PKG_MAINTAINER:=Nicholas Smith PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 diff --git a/luci-app-glorytun-udp/root/etc/config/glorytun-udp b/luci-app-glorytun-udp/root/etc/config/glorytun-udp index d5d356dd6..431da357a 100755 --- a/luci-app-glorytun-udp/root/etc/config/glorytun-udp +++ b/luci-app-glorytun-udp/root/etc/config/glorytun-udp @@ -8,3 +8,7 @@ config glorytun-udp 'vpn' option localip '10.255.254.2' option remoteip '10.255.254.1' option mode 'to' + option kxtimeout '7d' + option timetolerance '10m' + option keepalive '25s' + option rateauto '0' \ No newline at end of file diff --git a/luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js b/luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js index e7259c44a..f8bbc58c5 100755 --- a/luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js +++ b/luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js @@ -82,6 +82,12 @@ return L.view.extend({ o.rmempty = false; o.modalonly = true; + o = s.taboption('advanced', form.Value, 'latency_tolerance', _('Latency tolerance')); + o.default = '300'; + o.datatype = "uinteger"; + o.rmempty = false; + o.modalonly = true; + return m.render(); } }); diff --git a/luci-app-mptcp/luasrc/controller/mptcp.lua b/luci-app-mptcp/luasrc/controller/mptcp.lua index 33f39fcc6..c81458f80 100755 --- a/luci-app-mptcp/luasrc/controller/mptcp.lua +++ b/luci-app-mptcp/luasrc/controller/mptcp.lua @@ -210,13 +210,23 @@ function mptcp_monitor_data() luci.http.prepare_content("text/plain") local fullmesh fullmesh = io.popen("cat /proc/net/mptcp_net/snmp") - if fullmesh then + if fullmesh:read() ~= nil then while true do local ln = fullmesh:read("*l") if not ln then break end luci.http.write(ln) luci.http.write("\n") end + else + fullmesh = io.popen("nstat -z") + if fullmesh then + while true do + local ln = fullmesh:read("*l") + if not ln then break end + luci.http.write(ln) + luci.http.write("\n") + end + end end return end @@ -225,7 +235,7 @@ function mptcp_connections_data() luci.http.prepare_content("text/plain") local connections connections = io.popen("multipath -c") - if connections then + if connections:read() ~= nil then while true do local ln = connections:read("*l") if not ln then break end diff --git a/luci-app-mptcp/luasrc/model/cbi/mptcp.lua b/luci-app-mptcp/luasrc/model/cbi/mptcp.lua index 4b3bdb2b7..b9e7d0630 100755 --- a/luci-app-mptcp/luasrc/model/cbi/mptcp.lua +++ b/luci-app-mptcp/luasrc/model/cbi/mptcp.lua @@ -21,56 +21,74 @@ o:value(0, translate("disable")) o = s:option(ListValue, "mptcp_path_manager", translate("Multipath TCP path-manager"), translate("Default is fullmesh")) o:value("default", translate("default")) o:value("fullmesh", "fullmesh") -o:value("ndiffports", "ndiffports") -o:value("binder", "binder") -if uname.release:sub(1,4) ~= "4.14" then +if uname.release:sub(1,4) ~= "5.14" then + o:value("ndiffports", "ndiffports") + o:value("binder", "binder") + if uname.release:sub(1,4) ~= "4.14" then o:value("netlink", translate("Netlink")) + end end o = s:option(ListValue, "mptcp_scheduler", translate("Multipath TCP scheduler")) o:value("default", translate("default")) -o:value("roundrobin", "round-robin") -o:value("redundant", "redundant") -if uname.release:sub(1,4) ~= "4.14" then +if uname.release:sub(1,4) ~= "5.14" then + o:value("roundrobin", "round-robin") + o:value("redundant", "redundant") + if uname.release:sub(1,4) ~= "4.14" then o:value("blest", "BLEST") o:value("ecf", "ECF") + end +end +if uname.release:sub(1,4) ~= "5.14" then + o = s:option(Value, "mptcp_syn_retries", translate("Multipath TCP SYN retries")) + o.datatype = "uinteger" + o.rmempty = false end -o = s:option(Value, "mptcp_syn_retries", translate("Multipath TCP SYN retries")) -o.datatype = "uinteger" -o.rmempty = false o = s:option(ListValue, "congestion", translate("Congestion Control"),translate("Default is cubic")) local availablecong = sys.exec("sysctl -n net.ipv4.tcp_available_congestion_control | xargs -n1 | sort | xargs") for cong in string.gmatch(availablecong, "[^%s]+") do o:value(cong, translate(cong)) end -o = s:option(Value, "mptcp_fullmesh_num_subflows", translate("Fullmesh subflows for each pair of IP addresses")) -o.datatype = "uinteger" -o.rmempty = false -o.default = 1 ---o:depends("mptcp_path_manager","fullmesh") +if uname.release:sub(1,4) == "5.14" then + o = s:option(Value, "mptcp_subflows", translate("specifies the maximum number of additional subflows allowed for each MPTCP connection")) + o.datatype = "uinteger" + o.rmempty = false + o.default = 3 + + o = s:option(Value, "mptcp_add_addr_accepted", translate("specifies the maximum number of ADD_ADDR suboptions accepted for each MPTCP connection")) + o.datatype = "uinteger" + o.rmempty = false + o.default = 1 +else + o = s:option(Value, "mptcp_fullmesh_num_subflows", translate("Fullmesh subflows for each pair of IP addresses")) + o.datatype = "uinteger" + o.rmempty = false + o.default = 1 + --o:depends("mptcp_path_manager","fullmesh") -o = s:option(ListValue, "mptcp_fullmesh_create_on_err", translate("Re-create fullmesh subflows after a timeout")) -o:value(1, translate("enable")) -o:value(0, translate("disable")) ---o:depends("mptcp_path_manager","fullmesh") + o = s:option(ListValue, "mptcp_fullmesh_create_on_err", translate("Re-create fullmesh subflows after a timeout")) + o:value(1, translate("enable")) + o:value(0, translate("disable")) + --o:depends("mptcp_path_manager","fullmesh") -o = s:option(Value, "mptcp_ndiffports_num_subflows", translate("ndiffports subflows number")) -o.datatype = "uinteger" -o.rmempty = false -o.default = 1 ---o:depends("mptcp_path_manager","ndiffports") + o = s:option(Value, "mptcp_ndiffports_num_subflows", translate("ndiffports subflows number")) + o.datatype = "uinteger" + o.rmempty = false + o.default = 1 + --o:depends("mptcp_path_manager","ndiffports") -o = s:option(ListValue, "mptcp_rr_cwnd_limited", translate("Fill the congestion window on all subflows for round robin")) -o:value("Y", translate("enable")) -o:value("N", translate("disable")) -o.default = "Y" ---o:depends("mptcp_scheduler","roundrobin") + o = s:option(ListValue, "mptcp_rr_cwnd_limited", translate("Fill the congestion window on all subflows for round robin")) + o:value("Y", translate("enable")) + o:value("N", translate("disable")) + o.default = "Y" + --o:depends("mptcp_scheduler","roundrobin") -o = s:option(Value, "mptcp_rr_num_segments", translate("Consecutive segments that should be sent for round robin")) -o.datatype = "uinteger" -o.rmempty = false -o.default = 1 ---o:depends("mptcp_scheduler","roundrobin") + o = s:option(Value, "mptcp_rr_num_segments", translate("Consecutive segments that should be sent for round robin")) + o.datatype = "uinteger" + o.rmempty = false + o.default = 1 + --o:depends("mptcp_scheduler","roundrobin") +end s = m:section(TypedSection, "interface", translate("Interfaces Settings")) o = s:option(ListValue, "multipath", translate("Multipath TCP"), translate("One interface must be set as master")) diff --git a/luci-app-mptcp/luasrc/view/mptcp/multipath.htm b/luci-app-mptcp/luasrc/view/mptcp/multipath.htm index 8d375c359..97ea6e956 100755 --- a/luci-app-mptcp/luasrc/view/mptcp/multipath.htm +++ b/luci-app-mptcp/luasrc/view/mptcp/multipath.htm @@ -238,8 +238,8 @@ labelup_25.parentNode.appendChild(textup); } - labeldn_scale.innerHTML = String.format('<%:(%d minutes window, %d seconds interval)%>', 3, data_wanted / 60); - labelup_scale.innerHTML = String.format('<%:(%d minutes window, %d seconds interval)%>', 3, data_wanted / 60); + labeldn_scale.innerHTML = String.format('<%:(%d minutes window, %d seconds interval)%>', 4, data_wanted / 60); + labelup_scale.innerHTML = String.format('<%:(%d minutes window, %d seconds interval)%>', 4, data_wanted / 60); /* render datasets, start update interval */ XHR.poll(3, '<%=build_url(bandwidthtotalurl, all)%>', null, diff --git a/luci-app-omr-bypass/root/etc/init.d/omr-bypass b/luci-app-omr-bypass/root/etc/init.d/omr-bypass index db952d551..1aa237f91 100755 --- a/luci-app-omr-bypass/root/etc/init.d/omr-bypass +++ b/luci-app-omr-bypass/root/etc/init.d/omr-bypass @@ -100,12 +100,14 @@ _bypass_domain() { fi if [ "$(uci -q get dhcp.@dnsmasq[0].ipset | grep /$domain/)" = "" ]; then uci -q add_list dhcp.@dnsmasq[0].ipset="/$domain/omr_dst_bypass_$intf,omr6_dst_bypass_$intf" + add_domains="true" else dnsmasqipset=$(uci -q get dhcp.@dnsmasq[0].ipset | sed 's/ /\n/g') for dnsipset in $dnsmasqipset; do if [ "$(echo $dnsipset | cut -d/ -f2)" = "$domain" ]; then uci -q del_list dhcp.@dnsmasq[0].ipset=$dnsipset uci -q add_list dhcp.@dnsmasq[0].ipset="$dnsipset,omr_dst_bypass_$intf,omr6_dst_bypass_$intf" + add_domains="true" fi done fi @@ -680,6 +682,7 @@ boot() { start_service() { #local count logger -t "omr-bypass" "Starting OMR-ByPass..." + add_domains="false" config_load omr-bypass config_foreach _add_proto proto disableipv6="$(uci -q get openmptcprouter.settings.disable_ipv6)" @@ -797,11 +800,11 @@ start_service() { config_foreach _bypass_proto dpis uci -q commit omr-bypass - [ -z "$RELOAD" ] && { + [ -z "$RELOAD" ] && [ "$add_domains" = "true" ] && { logger -t "omr-bypass" "Restart dnsmasq..." /etc/init.d/dnsmasq restart } - [ -n "$RELOAD" ] && { + [ -n "$RELOAD" ] && [ "$add_domains" = "true" ] && { logger -t "omr-bypass" "Reload dnsmasq..." /etc/init.d/dnsmasq reload } diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index cca82d950..27bae5b7f 100755 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -38,6 +38,17 @@ function interface_from_device(dev) return "" end +function uci_device_from_interface(intf) + intfname = ucic:get("network",intf,"device") + deviceuci = "" + ucic:foreach("network", "device", function(s) + if intfname == ucic:get("network",s[".name"],"name") then + deviceuci = s[".name"] + end + end) + return deviceuci +end + function wizard_add() local gostatus = true @@ -273,6 +284,7 @@ function wizard_add() local sqmenabled = luci.http.formvalue("cbid.sqm.%s.enabled" % intf) or "0" local multipath = luci.http.formvalue("cbid.network.%s.multipath" % intf) or "on" local lan = luci.http.formvalue("cbid.network.%s.lan" % intf) or "0" + local ttl = luci.http.formvalue("cbid.network.%s.ttl" % intf) or "" if typeintf ~= "" then if typeintf == "normal" then typeintf = "" @@ -292,12 +304,34 @@ function wizard_add() ucic:set("network",intf,"masterintf",masterintf) elseif typeintf == "" and ifname ~= "" and (proto == "static" or proto == "dhcp" or proto == "dhcpv6") then ucic:set("network",intf,"device",ifname) + if uci_device_from_interface(intf) == "" then + ucic:set("network",intf .. "_dev","device") + ucic:set("network",intf .. "_dev","name",ifname) + end elseif typeintf == "" and device ~= "" and proto == "ncm" then ucic:set("network",intf,"device",device_ncm) + if uci_device_from_interface(intf) == "" then + ucic:set("network",intf .. "_dev","device") + ucic:set("network",intf .. "_dev","name",device_ncm) + end elseif typeintf == "" and device ~= "" and proto == "qmi" then ucic:set("network",intf,"device",device_qmi) + if uci_device_from_interface(intf) == "" then + ucic:set("network",intf .. "_dev","device") + ucic:set("network",intf .. "_dev","name",device_qmi) + end elseif typeintf == "" and device ~= "" and proto == "modemmanager" then ucic:set("network",intf,"device",device_manager) + if uci_device_from_interface(intf) == "" then + ucic:set("network",intf .. "_dev","device") + ucic:set("network",intf .. "_dev","name",device_manager) + end + elseif typeintf == "" and ifname ~= "" and proto == "static" then + ucic:set("network",intf,"device",ifname) + if uci_device_from_interface(intf) == "" then + ucic:set("network",intf .. "_dev","device") + ucic:set("network",intf .. "_dev","name",ifname) + end end if proto == "pppoe" then ucic:set("network",intf,"pppd_options","persist maxfail 0") @@ -305,6 +339,13 @@ function wizard_add() if proto ~= "other" then ucic:set("network",intf,"proto",proto) end + + uci_device = uci_device_from_interface(intf) + if uci_device == "" then + uci_device = intf .. "_dev" + end + ucic:set("network",uci_device,"ttl",ttl) + ucic:set("network",intf,"apn",apn) ucic:set("network",intf,"pincode",pincode) ucic:set("network",intf,"delay",delay) @@ -839,7 +880,7 @@ function wizard_add() local dsvpn_key = luci.http.formvalue("dsvpn_key") if dsvpn_key ~= "" then - ucic:set("dsvpn","vpn","port","65011") + ucic:set("dsvpn","vpn","port","65401") ucic:set("dsvpn","vpn","key",dsvpn_key) ucic:set("dsvpn","vpn","localip","10.255.251.2") ucic:set("dsvpn","vpn","remoteip","10.255.251.1") diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index 13cbffcf2..d3610bd36 100755 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -893,6 +893,16 @@ <% end %> +
+ +
+ +
+
+ <%:You can force a TTL. Some LTE provider detect tethering by inpecting packet TTL value, setting it to 65 often solve the issue.%> +
+
+
<% local download = "0" @@ -909,7 +919,7 @@ -- end --end %> -
+
checked<% end %> /> @@ -919,7 +929,7 @@
-
+
checked<% end %> /> @@ -929,7 +939,7 @@
-
+
@@ -945,7 +955,7 @@ -->
-
+
diff --git a/luci-app-openmptcprouter/root/bin/omr-mptcp-intf b/luci-app-openmptcprouter/root/bin/omr-mptcp-intf index d2a74b245..8fac4468b 100755 --- a/luci-app-openmptcprouter/root/bin/omr-mptcp-intf +++ b/luci-app-openmptcprouter/root/bin/omr-mptcp-intf @@ -12,9 +12,17 @@ get_mptcp_from_server() { get_mptcp() { serverip=$1 if [ "$(echo $serverip | grep :)" ]; then - support="$(curl -s -k -6 -m ${timeout} --interface $intf https://[$serverip]:$serverport/mptcpsupport)" + if [ -f /proc/sys/net/mptcp/enabled ]; then + support="$(mptcpize run curl -s -k -6 -m ${timeout} --interface $intf https://[$serverip]:$serverport/mptcpsupport)" + else + support="$(curl -s -k -6 -m ${timeout} --interface $intf https://[$serverip]:$serverport/mptcpsupport)" + fi else - support="$(curl -s -k -4 -m ${timeout} --interface $intf https://$serverip:$serverport/mptcpsupport)" + if [ -f /proc/sys/net/mptcp/enabled ]; then + support="$(mptcpize run curl -s -k -4 -m ${timeout} --interface $intf https://$serverip:$serverport/mptcpsupport)" + else + support="$(curl -s -k -4 -m ${timeout} --interface $intf https://$serverip:$serverport/mptcpsupport)" + fi fi [ -n "$support" ] && { support=$(echo $support | jsonfilter -e '@.mptcp') @@ -56,8 +64,10 @@ get_mptcp_from_website6() { support="" config_load openmptcprouter config_foreach get_mptcp_from_server server -[ -z "$support" ] && [ -n "$(ip -4 a show dev $intf)" ] && get_mptcp_from_website -[ -z "$support" ] && [ -n "$(ip -6 a show dev $intf)" ] && get_mptcp_from_website6 +if [ ! -f /proc/sys/net/mptcp/enabled ] && [ -z "$support" ]; then + [ -n "$(ip -4 a show dev $intf)" ] && get_mptcp_from_website + [ -n "$(ip -6 a show dev $intf)" ] && get_mptcp_from_website6 +fi if [ "$support" = "working" ]; then echo "MPTCP enabled" elif [ "$support" = "not working" ]; then diff --git a/luci-app-openmptcprouter/root/etc/init.d/openmptcprouter b/luci-app-openmptcprouter/root/etc/init.d/openmptcprouter index 87b908344..b4ded81ab 100755 --- a/luci-app-openmptcprouter/root/etc/init.d/openmptcprouter +++ b/luci-app-openmptcprouter/root/etc/init.d/openmptcprouter @@ -150,17 +150,15 @@ start_service() { if [ "$(uci -q get openmptcprouter.settings.country)" = "china" ] && [ -n "$(uci -q get dhcp.@dnsmasq[0].server | grep '127.0.0.1#5353')" ]; then uci -q batch <<-EOF > /dev/null del_list dhcp.@dnsmasq[0].server='127.0.0.1#5353' - add_list dhcp.@dnsmasq[0].server='114.114.114.114' + add_list dhcp.@dnsmasq[0].server='223.5.5.5' set dhcp.@dnsmasq[0].dnsseccheckunsigned='0' - delete dhcp.@dnsmasq[0].dnssec='1' + delete dhcp.@dnsmasq[0].dnssec commit dhcp EOF - elif [ "$(uci -q get openmptcprouter.settings.country)" = "world" ] && [ -n "$(uci -q get dhcp.@dnsmasq[0].server | grep '114.114.114.114')" ]; then + elif [ "$(uci -q get openmptcprouter.settings.country)" = "world" ] && [ -n "$(uci -q get dhcp.@dnsmasq[0].server | grep '223.5.5.5')" ]; then uci -q batch <<-EOF > /dev/null add_list dhcp.@dnsmasq[0].server='127.0.0.1#5353' - del_list dhcp.@dnsmasq[0].server='114.114.114.114' - set dhcp.@dnsmasq[0].dnsseccheckunsigned='1' - set dhcp.@dnsmasq[0].dnssec='1' + del_list dhcp.@dnsmasq[0].server='223.5.5.5' commit dhcp EOF fi diff --git a/luci-app-openmptcprouter/root/etc/sysctl.d/zzz_openmptcprouter.conf b/luci-app-openmptcprouter/root/etc/sysctl.d/zzz_openmptcprouter.conf index a6c46d370..214765274 100755 --- a/luci-app-openmptcprouter/root/etc/sysctl.d/zzz_openmptcprouter.conf +++ b/luci-app-openmptcprouter/root/etc/sysctl.d/zzz_openmptcprouter.conf @@ -1,4 +1,4 @@ -net.ipv4.tcp_keepalive_time=7200 +net.ipv4.tcp_keepalive_time=72000 net.ipv4.tcp_fin_timeout=60 net.ipv4.tcp_syn_retries=3 net.ipv4.tcp_retries1=3 diff --git a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter index 74543d056..e42883f1a 100755 --- a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter +++ b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter @@ -824,7 +824,7 @@ function interfaces_status() if mArray.openmptcprouter["external_check"] ~= false then mArray.openmptcprouter["proxy_addr"] = ut.trim(sys.exec("curl -s -4 --socks5 " .. tracker_ip .. ":" .. tracker_port .. " -m " .. timeout .. " " .. check_ipv4_website)) if mArray.openmptcprouter["proxy_addr"] == "" then - mArray.openmptcprouter["proxy_addr"] = ut.trim(sys.exec("curl -s -4 --socks5 " .. tracker_ip .. ":" .. tracker_port .. " -m " .. timeout .. " ifconfig.co")) + mArray.openmptcprouter["proxy_addr"] = ut.trim(sys.exec("curl -s -4 --socks5 " .. tracker_ip .. ":" .. tracker_port .. " -m " .. timeout .. " ifconfig.me")) end --mArray.openmptcprouter["ss_addr6"] = sys.exec("curl -s -6 --socks5 " .. tracker_ip .. ":" .. tracker_port .. " -m 3 http://ipv6.openmptcprouter.com") end @@ -1374,7 +1374,8 @@ function interfaces_status() if adminport == "" then adminport = "65500" end - if server_ping == "UP" and uci:get("openmptcprouter", "settings", "disableserverhttptest") ~= "1" and ipaddr ~= "" and adminport ~= "" then + -- httping disable for now, with -l (ssl) timeout is ignored + if false and server_ping == "UP" and uci:get("openmptcprouter", "settings", "disableserverhttptest") ~= "1" and ipaddr ~= "" and adminport ~= "" then local server_http_result = "" local server_http_test = "" if mArray.openmptcprouter["service_addr_ip"] ~= "" then diff --git a/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/10_router.js b/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/10_router.js index ad9278c53..cf69d4d0e 100755 --- a/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/10_router.js +++ b/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/10_router.js @@ -371,7 +371,7 @@ return baseclass.extend({ release: { title: _('Firmware Version'), - value: (typeof boardinfo.release.description !== "undefined") ? boardinfo.release.description : null + value: (typeof boardinfo.release !== "undefined") ? ((typeof boardinfo.release.description !== "undefined") ? boardinfo.release.description : null) : null } }; diff --git a/luci-mod-network/htdocs/luci-static/resources/tools/network.js b/luci-mod-network/htdocs/luci-static/resources/tools/network.js index 8efbd89d4..b08f84058 100644 --- a/luci-mod-network/htdocs/luci-static/resources/tools/network.js +++ b/luci-mod-network/htdocs/luci-static/resources/tools/network.js @@ -662,6 +662,10 @@ return baseclass.extend({ o.placeholder = '0'; o.datatype = 'uinteger'; + o = this.replaceOption(s, 'devadvanced', form.Value, 'ttl', _('Force TTL'), _('Some LTE providers detect tethering by inspecting packet TTL values')); + o.placeholder = '65'; + o.datatype = 'uinteger'; + o = this.replaceOption(s, 'devgeneral', form.Flag, 'ipv6', _('Enable IPv6')); o.migrate = false; o.default = o.enabled; diff --git a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/footer.htm b/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/footer.htm index c700afc0b..f78b911a5 100755 --- a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/footer.htm +++ b/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/footer.htm @@ -10,6 +10,7 @@
diff --git a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/header.htm b/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/header.htm index 459f654e4..6d690a569 100755 --- a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/header.htm +++ b/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/header.htm @@ -29,6 +29,9 @@ <%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - system + + + @@ -70,6 +73,12 @@
<%- end -%> +
+ + +