From 01558793adba80a26ccb99a3121e38b2e9140e72 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 17 Dec 2020 09:33:56 +0100 Subject: [PATCH 1/6] Add again BBR2 disable patch --- build.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 7894b0ce..8a3ebd24 100755 --- a/build.sh +++ b/build.sh @@ -237,12 +237,14 @@ fi echo "Done" # Add BBR2 patch, only working on 64bits images for now -echo "Checking if BBRv2 patch is set or not" -if ! patch -Rf -N -p1 -s --dry-run < ../../patches/bbr2.patch; then - echo "apply..." - patch -N -p1 -s < ../../patches/bbr2.patch +if [ "$OMR_TARGET" = "x86_64" ] || [ "$OMR_TARGET" = "bpi-r64" ] || [ "$OMR_TARGET" = "rpi4" ] || [ "$OMR_TARGET" = "espressobin" ] || [ "$OMR_TARGET" = "r2s" ] || [ "$OMR_TARGET" = "rpi3" ]; then + echo "Checking if BBRv2 patch is set or not" + if ! patch -Rf -N -p1 -s --dry-run < ../../patches/bbr2.patch; then + echo "apply..." + patch -N -p1 -s < ../../patches/bbr2.patch + fi + echo "Done" fi -echo "Done" echo "Checking if smsc75xx patch is set or not" if ! patch -Rf -N -p1 -s --dry-run < ../../patches/smsc75xx.patch; then From 1222a62634a33b99caa2780701bddd4416c8ebcd Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 23 Dec 2020 07:32:16 +0100 Subject: [PATCH 2/6] Update Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a332c0a9..ed21fbcd 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ OpenMPTCProuter is an open source solution to aggregate and encrypt multiple internet connections and terminates it over any VPS which make clients benefit security, reliability, net neutrality, as well as dedicated public IP. -The aggregation is based on Multipath TCP (MPTCP), which is ISP, WAN type, and latency independent "whether it was Fiber, VDSL, SHDSL, ADSL or even 4G", different scenarios can be configured to have either aggregation or failover based on MPTCP. +The aggregation is based on Multipath TCP (MPTCP), which is ISP, WAN type, and latency independent "whether it was Fiber, VDSL, SHDSL, ADSL, 4G or even 5G", different scenarios can be configured to have either aggregation or failover based on MPTCP. Aggregation via [Multi-link VPN (MLVPN)](https://github.com/markfoodyburton/MLVPN/commits/new-reorder) and [Glorytun UDP](https://github.com/angt/glorytun) with multipath support are also supported. From d5dd1a534cb5fb35110cb43cd4dcab47c18c368e Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Mon, 28 Dec 2020 14:43:01 +0100 Subject: [PATCH 3/6] Remove some bpi changes --- .../lib/preinit/06_set_rps_sock_flow | 8 -- .../base-files/lib/preinit/07_set_iface_mac | 48 ----------- .../base-files/lib/preinit/79_move_config | 19 ----- .../base-files/lib/preinit/90_init_jffs2 | 7 -- .../base-files/lib/upgrade/platform.sh | 85 ------------------- 5 files changed, 167 deletions(-) delete mode 100644 root/target/linux/mediatek/base-files/lib/preinit/06_set_rps_sock_flow delete mode 100644 root/target/linux/mediatek/base-files/lib/preinit/07_set_iface_mac delete mode 100644 root/target/linux/mediatek/base-files/lib/preinit/79_move_config delete mode 100644 root/target/linux/mediatek/base-files/lib/preinit/90_init_jffs2 delete mode 100755 root/target/linux/mediatek/base-files/lib/upgrade/platform.sh diff --git a/root/target/linux/mediatek/base-files/lib/preinit/06_set_rps_sock_flow b/root/target/linux/mediatek/base-files/lib/preinit/06_set_rps_sock_flow deleted file mode 100644 index 9a84ff4b..00000000 --- a/root/target/linux/mediatek/base-files/lib/preinit/06_set_rps_sock_flow +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -set_rps_sock_flow() { - echo 1024 > /proc/sys/net/core/rps_sock_flow_entries -} - -boot_hook_add preinit_main set_rps_sock_flow - diff --git a/root/target/linux/mediatek/base-files/lib/preinit/07_set_iface_mac b/root/target/linux/mediatek/base-files/lib/preinit/07_set_iface_mac deleted file mode 100644 index 1ad70145..00000000 --- a/root/target/linux/mediatek/base-files/lib/preinit/07_set_iface_mac +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Copyright (C) 2018 OpenWrt.org - -RECOVERY_PART=/dev/mmcblk0p1 - -preinit_set_mac_address() { - local mac - - . /lib/functions.sh - . /lib/functions/system.sh - - case $(board_name) in - 'bananapi,bpi-r2'|\ - "unielec,u7623"*) - if [ -b $RECOVERY_PART ]; then - insmod nls_cp437 - insmod nls_iso8859-1 - insmod fat - insmod vfat - mkdir -p /tmp/recovery - mount -o rw,noatime $RECOVERY_PART /tmp/recovery - - if [ -f "/tmp/recovery/mac_addr" ]; - then - mac=$(cat /tmp/recovery/mac_addr) - else - mac=$(cat /sys/class/net/eth0/address) - echo "$mac" > /tmp/recovery/mac_addr - fi - - sync - umount /tmp/recovery - rm -rf /tmp/recovery - fi - - ip link set dev lan address $mac 2> /dev/null - - mac=$(macaddr_add $mac 1) - - ip link set dev wan1 address $mac 2>/dev/null - ip link set dev wan2 address $mac 2>/dev/null - ip link set dev wan3 address $mac 2>/dev/null - ip link set dev wan4 address $mac 2>/dev/null - ;; - esac -} - -boot_hook_add preinit_main preinit_set_mac_address diff --git a/root/target/linux/mediatek/base-files/lib/preinit/79_move_config b/root/target/linux/mediatek/base-files/lib/preinit/79_move_config deleted file mode 100644 index e8e62883..00000000 --- a/root/target/linux/mediatek/base-files/lib/preinit/79_move_config +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# Copyright (C) 2015 OpenWrt.org - -RECOVERY_PART=/dev/mmcblk0p1 - -move_config() { - if [ -b $RECOVERY_PART ]; then - insmod nls_cp437 - insmod nls_iso8859-1 - insmod fat - insmod vfat - mkdir -p /recovery - mount -o rw,noatime $RECOVERY_PART /recovery - [ -f /recovery/sysupgrade.tgz ] && mv -f /recovery/sysupgrade.tgz / - umount /recovery - fi -} - -boot_hook_add preinit_mount_root move_config diff --git a/root/target/linux/mediatek/base-files/lib/preinit/90_init_jffs2 b/root/target/linux/mediatek/base-files/lib/preinit/90_init_jffs2 deleted file mode 100644 index 8a510b74..00000000 --- a/root/target/linux/mediatek/base-files/lib/preinit/90_init_jffs2 +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -do_firstboot() { - if [ "$(mount | grep jffs2)" = "" ]; then - /sbin/firstboot -y - fi -} -boot_hook_add preinit_main do_firstboot \ No newline at end of file diff --git a/root/target/linux/mediatek/base-files/lib/upgrade/platform.sh b/root/target/linux/mediatek/base-files/lib/upgrade/platform.sh deleted file mode 100755 index ee69952e..00000000 --- a/root/target/linux/mediatek/base-files/lib/upgrade/platform.sh +++ /dev/null @@ -1,85 +0,0 @@ -platform_do_upgrade() { - local board=$(board_name) - case "$board" in - "unielec,u7623"*) - #Keep the persisten random mac address (if it exists) - mkdir -p /tmp/recovery - mount -o rw,noatime /dev/mmcblk0p1 /tmp/recovery - [ -f "/tmp/recovery/mac_addr" ] && \ - mv -f /tmp/recovery/mac_addr /tmp/ - umount /tmp/recovery - - #1310720 is the offset in bytes from the start of eMMC and to - #the location of the kernel (2560 512 byte sectors) - get_image "$1" | dd of=/dev/mmcblk0 bs=1310720 seek=1 conv=fsync - - mount -o rw,noatime /dev/mmcblk0p1 /tmp/recovery - [ -f "/tmp/mac_addr" ] && mv -f /tmp/mac_addr /tmp/recovery - sync - umount /tmp/recovery - ;; - bananapi,bpi-r2) - local tar_file="$1" - - echo "flashing kernel" - tar xf $tar_file sysupgrade-7623n-bananapi-bpi-r2/kernel -O | mtd write - kernel - - echo "flashing rootfs" - tar xf $tar_file sysupgrade-7623n-bananapi-bpi-r2/root -O | mtd write - rootfs - ;; - *) - default_do_upgrade "$ARGV" - ;; - esac -} - -PART_NAME=firmware - -platform_check_image() { - local board=$(board_name) - - [ "$#" -gt 1 ] && return 1 - - case "$board" in - bananapi,bpi-r2) - local tar_file="$1" - local kernel_length=`(tar xf $tar_file sysupgrade-7623n-bananapi-bpi-r2/kernel -O | wc -c) 2> /dev/null` - local rootfs_length=`(tar xf $tar_file sysupgrade-7623n-bananapi-bpi-r2/root -O | wc -c) 2> /dev/null` - [ "$kernel_length" = 0 -o "$rootfs_length" = 0 ] && { - echo "The upgrade image is corrupt." - return 1 - } - ;; - "unielec,u7623"*) - local magic="$(get_magic_long "$1")" - [ "$magic" != "27051956" ] && { - echo "Invalid image type." - return 1 - } - return 0 - ;; - - *) - echo "Sysupgrade is not supported on your board yet." - return 1 - ;; - esac - - return 0 -} - -platform_copy_config_emmc() { - mkdir -p /recovery - mount -o rw,noatime /dev/mmcblk0p1 /recovery - cp -af "$CONF_TAR" /recovery/ - sync - umount /recovery -} - -platform_copy_config() { - case "$(board_name)" in - "unielec,u7623"*) - platform_copy_config_emmc - ;; - esac -} From ff8441888822ef418a99e9761dd237eb4537c167 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 30 Dec 2020 16:53:02 +0100 Subject: [PATCH 4/6] Close issues after 90 days instead of 120 --- .github/workflows/stale.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 0df84802..7c2090c3 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -12,9 +12,9 @@ jobs: - uses: actions/stale@v3.0.10 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: "This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days" - stale-pr-message: 'It has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days' - days-before-stale: 120 + stale-issue-message: "This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days" + stale-pr-message: 'It has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days' + days-before-stale: 90 days-before-close: 5 exempt-issue-labels: 'work-in-progress,enhancement' exempt-pr-labels: 'work-in-progress,enhancement' From 62f6e0b94ffef8f7ab3945f55ffb9f5277c6f6e8 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 30 Dec 2020 18:16:40 +0100 Subject: [PATCH 5/6] Fix banner version --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 8a3ebd24..d56c61d8 100755 --- a/build.sh +++ b/build.sh @@ -116,7 +116,7 @@ cp -rf root/* "$OMR_TARGET/source" cat >> "$OMR_TARGET/source/package/base-files/files/etc/banner" < Date: Mon, 4 Jan 2021 14:27:16 +0100 Subject: [PATCH 6/6] Apply patch from tessares: mptcp: avoid meta zerowindow impacting subflow --- .../generic/hack-5.4/690-mptcp_trunk.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/root/target/linux/generic/hack-5.4/690-mptcp_trunk.patch b/root/target/linux/generic/hack-5.4/690-mptcp_trunk.patch index eb246722..4161cd00 100644 --- a/root/target/linux/generic/hack-5.4/690-mptcp_trunk.patch +++ b/root/target/linux/generic/hack-5.4/690-mptcp_trunk.patch @@ -23651,3 +23651,33 @@ diff -aurN linux-5.4.64/tools/include/uapi/linux/bpf.h linux-5.4.64.mptcp/tools/ BPF_TCP_MAX_STATES /* Leave at the end! */ }; +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c +index 37e229d2f615..b428f61d959c 100644 +--- linux-5.4.64/net/ipv4/tcp_input.c ++++ linux-5.4.64.mptcp/net/ipv4/tcp_input.c +@@ -4842,7 +4842,24 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) + * Out of sequence packets to the out_of_order_queue. + */ + if (TCP_SKB_CB(skb)->seq == tp->rcv_nxt) { +- if (tcp_receive_window(tp) == 0) { ++ /* Receiving data on a zero window in MPTCP can occur due to ++ * reinjected data sent on another subflow filling the ++ * window. This semi-frequently occurs due to penalization ++ * while initially growing the congestion window. ++ * For the subflow, dropping the packet is seen (wrongly) as a ++ * loss, impacting the congestion control. ++ * ++ * To avoid this, accept the packet at the subflow level, and ++ * let the meta handle the segment. ++ * If it was a duplicate segment, or if it was a new segment ++ * somehow (a bug in the sender), it is up to the meta level to ++ * handle this and drop the segment. mptcp_data_ready is able to ++ * handle either case. ++ * ++ * We still check for rmem constraints, so there is no risk of ++ * queueing too much data. ++ */ ++ if (tcp_receive_window(tp) == 0 && !mptcp(tp)) { + NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPZEROWINDOWDROP); + goto out_of_window; + }