From 3959237a3d1b77417d3c8aac3ad1c640c5cb4ed4 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Sun, 23 Jul 2023 09:12:27 +0200 Subject: [PATCH] Should add MPTCP support to v2ray... --- v2ray-core/files/etc/init.d/v2ray | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/v2ray-core/files/etc/init.d/v2ray b/v2ray-core/files/etc/init.d/v2ray index 5eac8c265..d704c337f 100755 --- a/v2ray-core/files/etc/init.d/v2ray +++ b/v2ray-core/files/etc/init.d/v2ray @@ -1944,6 +1944,16 @@ clear_transparent_proxy() { fi } +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 section="$1" @@ -2054,10 +2064,14 @@ start_instance() { return 1 fi fi + + PROG="$NAME.$section" TRANSPARENT_PROXY_EXPECTED=1 - - procd_open_instance "$NAME.$section" + if version_over_5_4; then + PROG="mptcpize run ${PROG}" + fi + procd_open_instance "$PROG" procd_set_param command "$v2ray_file" procd_append_param command run procd_append_param command -config "$temp_config"