Giter Club home page Giter Club logo

tcp-brutal's People

Contributors

haruue avatar mumumu4 avatar tobyxdd avatar xdqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tcp-brutal's Issues

tcp-brutal与udp-brutal

个人使用感受,在同样的线路上跑tcp brutal没有udp brutal效果明显。tcp brutal速度不稳定也达不到设定速度。
个人觉得tcp brutal速度不稳定可能是受到tcp底层协议原理影响,tcp底层是顺序发包和顺序收包,一旦发生丢包就会阻塞重传。这样会不会是tcp brutal速度不稳定的主要原因。
能不能绕过TCP底层重传,打破TCP底层包顺序传输,是tcp brutal像udp brutal一样稳定的关键。
个人愚意,有不对的地方请指教。

【求助】脚本 1.0.1 安装失败-系统 Ubuntu 20.04.4 LTS Linux 6.6.1

系统信息

root@sg1:~# hostnamectl
   Static hostname: sg1
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 32f94651ef1046b593be123a24a353b7
           Boot ID: 0e24ce8add424f22aa5e3213d4220ec2
    Virtualization: kvm
  Operating System: Ubuntu 20.04.4 LTS
            Kernel: Linux 6.6.1
      Architecture: x86-64

root@sg1:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

root@sg1:~# uname -a
Linux sg1 6.6.1 #1 SMP PREEMPT_DYNAMIC Fri Nov 10 08:09:00 CST 2023 x86_64 x86_64 x86_64 GNU/Linux

root@sg1:~# dpkg --list | grep linux-image
ii  linux-image-6.6.1                      6.6.1-1                           amd64        Linux kernel, version 6.6.1

安装错误日志

root@sg1:~# bash <(curl -fsSL https://tcp.hy2.sh/)
Checking linux-headers ... ok
Cleaning old installations ... 
Checking installed version ... v1.0.1
Checking latest version ... v1.0.1
Rebuilding DKMS modules as needed ... 

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j2 KERNELRELEASE=6.6.1 KERNEL_DIR=/lib/modules/6.6.1/build all...(bad exit status: 2)
ERROR (dkms apport): binary package for tcp-brutal: 1.0.1 not found
Error! Bad return status for module build on kernel: 6.6.1 (x86_64)
Consult /var/lib/dkms/tcp-brutal/1.0.1/build/make.log for more information.
Enabling auto load kernel module brutal on system boot ... ok
Loading kernel module brutal ... modprobe: FATAL: Module brutal not found in directory /lib/modules/6.6.1
bash <(curl -fsSL https://tcp.hy2.sh): error: Failed to load kernel module, kernel module might not be installed successfully.
bash <(curl -fsSL https://tcp.hy2.sh): warning: tcp-brutal is installed but failed to load.
There is nothing to do today.

root@sg1:~# cat /var/lib/dkms/tcp-brutal/1.0.0/build/make.log
cat: /var/lib/dkms/tcp-brutal/1.0.0/build/make.log: No such file or directory

debug 安装

bash -x install_dkms.sh 
+ set -e
+ SCRIPT_ARGS=("$@")
+ SCRIPT_INITIATOR_URL=https://tcp.hy2.sh
+ SCRIPT_INITIATOR_COMMAND='bash <(curl -fsSL https://tcp.hy2.sh)'
+ REPO_URL=https://github.com/apernet/tcp-brutal
+ HY2_API_BASE_URL=https://api.hy2.io/v1
+ CURL_FLAGS=(-L -f -q --retry 5 --retry-delay 10 --retry-max-time 60)
+ DKMS_MODULE_NAME=tcp-brutal
+ KERNEL_MODULE_NAME=brutal
+ PACKAGE_MANAGEMENT_INSTALL=
++ tput setaf 1
++ has_command tput
++ local _command=tput
++ type -P tput
++ command tput setaf 1
++ tput setaf 1
+ tred=''
++ tput setaf 2
++ has_command tput
++ local _command=tput
++ type -P tput
++ command tput setaf 2
++ tput setaf 2
+ tgreen=''
++ tput setaf 3
++ has_command tput
++ local _command=tput
++ type -P tput
++ command tput setaf 3
++ tput setaf 3
+ tyellow=''
++ tput setaf 4
++ has_command tput
++ local _command=tput
++ type -P tput
++ command tput setaf 4
++ tput setaf 4
+ tblue=''
++ tput setaf 6
++ has_command tput
++ local _command=tput
++ type -P tput
++ command tput setaf 6
++ tput setaf 6
+ taoi=''
++ tput bold
++ has_command tput
++ local _command=tput
++ type -P tput
++ command tput bold
++ tput bold
+ tbold=''
++ tput sgr0
++ has_command tput
++ local _command=tput
++ type -P tput
++ command tput sgr0
++ tput sgr0
+ treset=''
+ main
+ check_show_usage_and_exit
+ case "$1" in
+ [[ 0 -gt 0 ]]
+ check_permission
+ [[ 0 -eq 0 ]]
+ return
+ check_environment
+ check_environment_operating_system
++ uname
+ [[ xLinux == \x\L\i\n\u\x ]]
+ return
+ check_environment_curl
+ has_command curl
+ local _command=curl
+ type -P curl
+ return
+ check_environment_grep
+ has_command grep
+ local _command=grep
+ type -P grep
+ return
+ check_environment_dkms
+ has_command dkms
+ local _command=dkms
+ type -P dkms
+ return
+ check_linux_headers
+ echo -n 'Checking linux-headers ... '
Checking linux-headers ... + is_linux_headers_installed
++ uname -r
+ test -d /lib/modules/6.6.1/build
+ echo ok
ok
+ case "$1" in
+ perform_install
+ local _local_file=
+ local _user_provided_local_file=
+ local _version=
+ local _install_needed=
+ [[ 0 -gt 0 ]]
+ [[ -n '' ]]
+ echo 'Cleaning old installations ... '
Cleaning old installations ... 
+ dkms_remove_modules tcp-brutal 1
+ local _module=tcp-brutal
+ local _keep_latest=1
+ _versions_to_remove=($(dkms_get_installed_versions "$_module"))
++ dkms_get_installed_versions tcp-brutal
++ local _module=tcp-brutal
++ local _dkms_moddir=/var/lib/dkms/tcp-brutal
++ [[ ! -d /var/lib/dkms/tcp-brutal ]]
+++ command ls /var/lib/dkms/tcp-brutal/
+++ ls /var/lib/dkms/tcp-brutal/
++ for file in $(command ls "$_dkms_moddir/")
++ [[ -L /var/lib/dkms/tcp-brutal/1.0.1 ]]
++ echo v1.0.1
+ local _versions_to_remove
+ [[ -n 1 ]]
+ local _latest=
+ local _new_versions_to_remove
+ _new_versions_to_remove=()
+ for version in "${_versions_to_remove[@]}"
++ vercmp v1.0.1 ''
++ local _lhs=1.0.1
++ local _rhs=
++ [[ -n 1.0.1 ]]
++ [[ -n '' ]]
++ [[ x1.0.1 == \x ]]
++ [[ -z 1.0.1 ]]
++ [[ -z '' ]]
++ echo 1
++ return
+ local _vercmp=1
+ [[ 1 -gt 0 ]]
+ [[ -n '' ]]
+ _latest=v1.0.1
+ _versions_to_remove=("${_new_versions_to_remove[@]}")
+ echo -n 'Checking installed version ... '
Checking installed version ... ++ dkms_get_installed_versions tcp-brutal
++ local _module=tcp-brutal
++ local _dkms_moddir=/var/lib/dkms/tcp-brutal
++ [[ ! -d /var/lib/dkms/tcp-brutal ]]
++ head -1
+++ command ls /var/lib/dkms/tcp-brutal/
+++ ls /var/lib/dkms/tcp-brutal/
++ for file in $(command ls "$_dkms_moddir/")
++ [[ -L /var/lib/dkms/tcp-brutal/1.0.1 ]]
++ echo v1.0.1
+ local _installed_version=v1.0.1
+ [[ -n v1.0.1 ]]
+ echo v1.0.1
v1.0.1
+ [[ -z '' ]]
+ [[ -z '' ]]
+ echo -n 'Checking latest version ... '
Checking latest version ... ++ get_latest_version
++ [[ -n '' ]]
+++ mktemp
+++ command mktemp /tmp/brutalinst.XXXXXXXXXX
+++ mktemp /tmp/brutalinst.XXXXXXXXXX
++ local _tmpfile=/tmp/brutalinst.V9GDcpHXXd
++ curl -sS 'https://api.hy2.io/v1/update?cver=installscript&arch=generic&plat=linux&chan=tcp-brutal' -o /tmp/brutalinst.V9GDcpHXXd
++ command curl -L -f -q --retry 5 --retry-delay 10 --retry-max-time 60 -sS 'https://api.hy2.io/v1/update?cver=installscript&arch=generic&plat=linux&chan=tcp-brutal' -o /tmp/brutalinst.V9GDcpHXXd
++ curl -L -f -q --retry 5 --retry-delay 10 --retry-max-time 60 -sS 'https://api.hy2.io/v1/update?cver=installscript&arch=generic&plat=linux&chan=tcp-brutal' -o /tmp/brutalinst.V9GDcpHXXd
+++ grep -oP '"lver":\s*\K"v.*?"' /tmp/brutalinst.V9GDcpHXXd
+++ head -1
++ local '_latest_version="v1.0.1"'
++ _latest_version='v1.0.1"'
++ _latest_version=v1.0.1
++ [[ -n v1.0.1 ]]
++ echo v1.0.1
++ rm -f /tmp/brutalinst.V9GDcpHXXd
+ local _latest_version=v1.0.1
+ [[ -n v1.0.1 ]]
+ echo v1.0.1
v1.0.1
+ _version=v1.0.1
+ [[ -z '' ]]
+ [[ -n v1.0.1 ]]
++ vercmp v1.0.1 v1.0.1
++ local _lhs=1.0.1
++ local _rhs=1.0.1
++ [[ -n 1.0.1 ]]
++ [[ -n 1.0.1 ]]
++ local _clhs=1
++ local _crhs=1
+++ vercmp_segment 1 1
+++ local _lhs=1
+++ local _rhs=1
+++ [[ x1 == \x\1 ]]
+++ echo 0
+++ return
++ local _segcmp=0
++ [[ 0 -ne 0 ]]
++ _lhs=.0.1
++ _lhs=0.1
++ _rhs=.0.1
++ _rhs=0.1
++ [[ -n 0.1 ]]
++ [[ -n 0.1 ]]
++ local _clhs=0
++ local _crhs=0
+++ vercmp_segment 0 0
+++ local _lhs=0
+++ local _rhs=0
+++ [[ x0 == \x\0 ]]
+++ echo 0
+++ return
++ local _segcmp=0
++ [[ 0 -ne 0 ]]
++ _lhs=.1
++ _lhs=1
++ _rhs=.1
++ _rhs=1
++ [[ -n 1 ]]
++ [[ -n 1 ]]
++ local _clhs=1
++ local _crhs=1
+++ vercmp_segment 1 1
+++ local _lhs=1
+++ local _rhs=1
+++ [[ x1 == \x\1 ]]
+++ echo 0
+++ return
++ local _segcmp=0
++ [[ 0 -ne 0 ]]
++ _lhs=
++ _lhs=
++ _rhs=
++ _rhs=
++ [[ -n '' ]]
++ [[ x == \x ]]
++ echo 0
++ return
+ local _vercmp=0
+ [[ 0 -lt 0 ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -z '' ]]
+ [[ -n '' ]]
+ echo 'Rebuilding DKMS modules as needed ... '
Rebuilding DKMS modules as needed ... 
+ dkms autoinstall

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j2 KERNELRELEASE=6.6.1 KERNEL_DIR=/lib/modules/6.6.1/build all...(bad exit status: 2)
ERROR (dkms apport): binary package for tcp-brutal: 1.0.1 not found
Error! Bad return status for module build on kernel: 6.6.1 (x86_64)
Consult /var/lib/dkms/tcp-brutal/1.0.1/build/make.log for more information.
+ kmod_setup_autoload brutal
+ local _module=brutal
+ echo -n 'Enabling auto load kernel module brutal on system boot ... '
Enabling auto load kernel module brutal on system boot ... + echo brutal
+ echo ok
ok
+ [[ -z '' ]]
+ kmod_load_if_unloaded brutal
+ local _module=brutal
+ kmod_is_loaded brutal
+ local _module=brutal
+ lsmod
+ grep -qP '\bbrutal\b'
+ echo -n 'Loading kernel module brutal ... '
Loading kernel module brutal ... + modprobe brutal
modprobe: FATAL: Module brutal not found in directory /lib/modules/6.6.1
+ error 'Failed to load kernel module, kernel module might not be installed successfully.'
+ local '_msg=Failed to load kernel module, kernel module might not be installed successfully.'
++ script_name
++ local _keep_dirname=
++ is_run_from_fd
++ has_prefix install_dkms.sh /dev/
++ local _s=install_dkms.sh
++ local _prefix=/dev/
++ [[ -z /dev/ ]]
++ [[ -z install_dkms.sh ]]
++ [[ xinstall_dkms.sh != \x\i\n\s\t\a\l\l\_\d\k\m\s\.\s\h ]]
++ has_prefix install_dkms.sh /proc/
++ local _s=install_dkms.sh
++ local _prefix=/proc/
++ [[ -z /proc/ ]]
++ [[ -z install_dkms.sh ]]
++ [[ xinstall_dkms.sh != \x\i\n\s\t\a\l\l\_\d\k\m\s\.\s\h ]]
++ has_prefix install_dkms.sh .
++ local _s=install_dkms.sh
++ local _prefix=.
++ [[ -z . ]]
++ [[ -z install_dkms.sh ]]
++ [[ xinstall_dkms.sh != \x\i\n\s\t\a\l\l\_\d\k\m\s\.\s\h ]]
++ [[ -z '' ]]
++ basename install_dkms.sh
++ return
+ echo -e 'install_dkms.sh: error: Failed to load kernel module, kernel module might not be installed successfully.'
install_dkms.sh: error: Failed to load kernel module, kernel module might not be installed successfully.
+ return 1
+ warning 'tcp-brutal is installed but failed to load.'
+ local '_msg=tcp-brutal is installed but failed to load.'
++ script_name
++ local _keep_dirname=
++ is_run_from_fd
++ has_prefix install_dkms.sh /dev/
++ local _s=install_dkms.sh
++ local _prefix=/dev/
++ [[ -z /dev/ ]]
++ [[ -z install_dkms.sh ]]
++ [[ xinstall_dkms.sh != \x\i\n\s\t\a\l\l\_\d\k\m\s\.\s\h ]]
++ has_prefix install_dkms.sh /proc/
++ local _s=install_dkms.sh
++ local _prefix=/proc/
++ [[ -z /proc/ ]]
++ [[ -z install_dkms.sh ]]
++ [[ xinstall_dkms.sh != \x\i\n\s\t\a\l\l\_\d\k\m\s\.\s\h ]]
++ has_prefix install_dkms.sh .
++ local _s=install_dkms.sh
++ local _prefix=.
++ [[ -z . ]]
++ [[ -z install_dkms.sh ]]
++ [[ xinstall_dkms.sh != \x\i\n\s\t\a\l\l\_\d\k\m\s\.\s\h ]]
++ [[ -z '' ]]
++ basename install_dkms.sh
++ return
+ echo -e 'install_dkms.sh: warning: tcp-brutal is installed but failed to load.'
install_dkms.sh: warning: tcp-brutal is installed but failed to load.
+ echo 'There is nothing to do today.'
There is nothing to do today.
+ exit 0

时不时断连!

两个vps 之前部署其他没断过都有开xMux ,用XTLS_REALITY +TCP Brutal 时不时断连!要重新连接才能可以用。好像Mux 用h2mux就会断链

非issue,提供一个Ubuntu 20.04升级GCC和GLIBC_2.34的方法大家参考

20.04的GCC默认9.40,而libc6最高只有GLIBC_2.30,都无法正常编译安装TCP Brutal。

升级方法如下:(root)
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update
apt remove gcc-9 g++-9
apt autoremove
apt-get install gcc-13 g++-13
ln -sf /usr/bin/gcc-13 /usr/bin/gcc
ln -sf /usr/bin/g++-13 /usr/bin/g++
gcc -v
至此GCC应该升到13.1.0了。

(!!!以下需要在focal中使用高版本jammy源,可能会存在一定风险,请先测试后再决定是否需要增加!!!)
升级libc6:(root)
vi /etc/apt/sources.list
增加一个jammy源:deb http://mirrors.aliyun.com/ubuntu/ jammy main
apt-get update
apt install libc6
strings /lib/x86_64-linux-gnu/libc.so.6 |grep GLIBC_
至此应该见到最高版本为GLIBC_2.35

之后就可以正常安装TCP Brutal了。AWS的lightsail, $3.5只有512M内存,22.04跑得很累,很容易爆内存,但是20.04就比较舒服了。以上AWS lightsail $3.5刀 Ubuntu 20.04测试通过。补充:内核已经升到6.6.3!
image

安装在PVE nat(debian 12)上出现:error: Cannot install 'linux-headers-6.1.0-10-cloud-amd64'

Checking linux-headers ... not installed
Try to install linux-headers for 6.1.0-10-cloud-amd64 ...
Installing missing dependence 'linux-headers-6.1.0-10-cloud-amd64' with 'apt -y --no-install-recommends install' ...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-headers-6.1.0-10-cloud-amd64
E: Couldn't find any package by glob 'linux-headers-6.1.0-10-cloud-amd64'
bash <(curl -fsSL https://tcp.hy2.sh/): error: Cannot install 'linux-headers-6.1.0-10-cloud-amd64' with detected package manager, please install it manually.

libc.so.6: version `GLIBC_2.38' not found

hi . i get this error

output for bash <(curl -fsSL https://tcp.hy2.sh/)

Checking linux-headers ... ok
Cleaning old installations ...
Checking installed version ... v1.0.2
Checking latest version ... v1.0.2
Rebuilding DKMS modules as needed ...
Sign command: /lib/modules/6.8.10-x64v4-xanmod1/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
make -j2 KERNELRELEASE=6.8.10-x64v4-xanmod1 KERNEL_DIR=/lib/modules/6.8.10-x64v4-xanmod1/build all...(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.8.10-x64v4-xanmod1 (x86_64)
Consult /var/lib/dkms/tcp-brutal/1.0.2/build/make.log for more information.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
bash <(curl -fsSL https://tcp.hy2.sh): warning: Error occurred in 'dkms autoinstall', please check above output.
Enabling auto load kernel module brutal on system boot ... ok
Loading kernel module brutal ... modprobe: FATAL: Module brutal not found in directory /lib/modules/6.8.10-x64v4-xanmod1
bash <(curl -fsSL https://tcp.hy2.sh): error: Failed to load kernel module, kernel module might not be installed successfully.
bash <(curl -fsSL https://tcp.hy2.sh): warning: tcp-brutal is installed but failed to load.
There is nothing to do today.

output for cat /var/lib/dkms/tcp-brutal/1.0.2/build/make.log

DKMS make.log for tcp-brutal-1.0.2 for kernel 6.8.10-x64v4-xanmod1 (x86_64)
Tue May 21 09:14:34 PM CEST 2024
make -C /lib/modules/6.8.10-x64v4-xanmod1/build M=/var/lib/dkms/tcp-brutal/1.0.2/build modules
make[1]: Entering directory '/usr/src/linux-headers-6.8.10-x64v4-xanmod1'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc-13 (Debian 13.2.0-24) 13.2.0
  You are using:           gcc (Debian 12.2.0-14) 12.2.0
  CC [M]  /var/lib/dkms/tcp-brutal/1.0.2/build/brutal.o
/var/lib/dkms/tcp-brutal/1.0.2/build/brutal.c:38:5: warning: no previous prototype for ‘tcp_sock_get_sec’ [-Wmissing-prototypes]
   38 | u64 tcp_sock_get_sec(const struct tcp_sock *tp)
      |     ^~~~~~~~~~~~~~~~
./tools/objtool/objtool: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by ./tools/objtool/objtool)
make[3]: *** [scripts/Makefile.build:243: /var/lib/dkms/tcp-brutal/1.0.2/build/brutal.o] Error 1
make[3]: *** Deleting file '/var/lib/dkms/tcp-brutal/1.0.2/build/brutal.o'
make[2]: *** [/usr/src/linux-headers-6.8.10-x64v4-xanmod1/Makefile:2073: /var/lib/dkms/tcp-brutal/1.0.2/build] Error 2
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.8.10-x64v4-xanmod1'
make: *** [Makefile:13: all] Error 2

output for uname -a

Linux s02 6.8.10-x64v4-xanmod1 #0~20240517.g2e7da9e SMP PREEMPT_DYNAMIC Fri May 17 18:22:26 UTC x86_64 GNU/Linux

Installing missing dependence 'linux-headers-6.1.0-20-arm64'

服务器是debian12,安装提示缺少这个依赖。我看了下issues里有个类似的问题,我就apt search linux-headers-6.1.0-*-arm64,搜索后没有20,20附近只有linux-headers-6.1.0-18-arm64linux-headers-6.1.0-21-arm64,18和21分别安装成功后,还是安装失败,依赖只认20。
请问如果安装了21后,可以忽略这个20的依赖,正常使用吗?

提供一个32bit(arm)系统下的安装经验供参考

手上有一个运行32bit debian的 arm 旧板子,尝试安装的时候报错:

ERROR: modpost: "__aeabi_uldivmod" [/123/tcp-brutal/brutal.ko] undefined!
ERROR: modpost: "__aeabi_ldivmod" [/123/tcp-brutal/brutal.ko] undefined!

google后参考了以下链接(1, 2)修改后可以正常编译通过

diff --git a/brutal.c b/brutal.c
index 98eebf1..7f56cfa 100644
--- a/brutal.c
+++ b/brutal.c
@@ -1,6 +1,7 @@
 #include <linux/module.h>
 #include <linux/version.h>
 #include <net/tcp.h>
+#include <linux/math64.h>

 #if IS_ENABLED(CONFIG_IPV6) && LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
 #include <net/transp_v6.h>
@@ -36,19 +37,19 @@
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
 u64 tcp_sock_get_sec(const struct tcp_sock *tp)
 {
-    return tp->tcp_mstamp / USEC_PER_SEC;
+    return div_u64(tp->tcp_mstamp, USEC_PER_SEC);
 }
 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
 // see https://github.com/torvalds/linux/commit/9a568de4818dea9a05af141046bd3e589245ab83
 u64 tcp_sock_get_sec(const struct tcp_sock *tp)
 {
-    return tp->tcp_mstamp.stamp_us / USEC_PER_SEC;
+    return div_u64(tp->tcp_mstamp.stamp_us, USEC_PER_SEC);
 }
 #else
 #include <linux/jiffies.h>
 u64 tcp_sock_get_sec(const struct tcp_sock *tp)
 {
-    return jiffies_to_usecs(tcp_time_stamp) / USEC_PER_SEC;
+    return div_u64(jiffies_to_usecs(tcp_time_stamp), USEC_PER_SEC);
 }
 #endif

@@ -214,10 +215,10 @@ static void brutal_update_rate(struct sock *sk)
     }

     rate *= 100;
-    rate /= ack_rate;
+    rate = div_u64(rate, ack_rate);

     // The order here is chosen carefully to avoid overflow as much as possible
-    cwnd = rate / MSEC_PER_SEC;
+    cwnd = div_u64(rate, MSEC_PER_SEC);
     cwnd *= rtt_ms;
     cwnd /= mss;
     cwnd *= brutal->cwnd_gain;

本地修改后的文件安装成 dkms 模块:

make dkms-tarball
./scripts/install_dkms.sh -l dkms.tar.gz

可以正常加载,还不知道之后会不会炸

折腾过程记录在这,也许能帮到遇到相同问题的后来者,虽然现在32位的设备似乎越来越少了

服务器上已经安装好,客户端使用时报错

一台bwh的机器上已经安装好了,sing-box上使用时确报这个,尝试换过其它家机器是没问题的

enable TCP Brutal: setsockopt IPPROTO_TCP TCP_CONGESTION burtal: operation not permitted: please make sure you have installed the tcp-brutal kernal module

有一个问题反馈

问了chatgpt我也没解决办法就来问你了,我的内核是bbr的6.6.1版本,但是我无法安装你的这个模块请看问题代码如下:

root@hks1-20231110231330b4e904:# bash <(curl -fsSL https://tcp.hy2.sh/)
Checking linux-headers ... ok
Cleaning old installations ...
Checking installed version ... v1.0.0
Checking latest version ... v1.0.0
Rebuilding DKMS modules as needed ...
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area...
make -j1 KERNELRELEASE=6.6.1 KERNEL_DIR=/lib/modules/6.6.1/build all...(bad exit status: 2)
ERROR (dkms apport): binary package for tcp-brutal: 1.0.0 not found
Error! Bad return status for module build on kernel: 6.6.1 (x86_64)
Consult /var/lib/dkms/tcp-brutal/1.0.0/build/make.log for more information.
Enabling auto load kernel module brutal on system boot ... ok
Loading kernel module brutal ... modprobe: FATAL: Module brutal not found in directory /lib/modules/6.6.1
bash <(curl -fsSL https://tcp.hy2.sh): error: Failed to load kernel module, kernel module might not be installed successfully.
bash <(curl -fsSL https://tcp.hy2.sh): warning: tcp-brutal is installed but failed to load.
There is nothing to do today.
root@hks1-20231110231330b4e904:
# uname -r
6.6.1

可以看下图片,请宇宙第一帅哥看一下Screenshot_2023-11-15-12-11-44-783_com.server.auditor.ssh.client.jpg

谢谢你

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.