From fb3430207c686fa71e903e70dba36ae278b7331d Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sat, 5 Oct 2019 11:03:38 -0500 Subject: [PATCH] don't fail if there's an error setting bbr, just log it and continue --- src/yggdrasil/tcp_linux.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/yggdrasil/tcp_linux.go b/src/yggdrasil/tcp_linux.go index d957ceb..90a55d7 100644 --- a/src/yggdrasil/tcp_linux.go +++ b/src/yggdrasil/tcp_linux.go @@ -19,10 +19,14 @@ func (t *tcp) tcpContext(network, address string, c syscall.RawConn) error { bbr = unix.SetsockoptString(int(fd), unix.IPPROTO_TCP, unix.TCP_CONGESTION, "bbr") }) - switch { - case bbr != nil: - return bbr - default: - return control + // Log any errors + if bbr != nil { + t.link.core.log.Debugln("Failed to set tcp_congestion_control to bbr for socket, SetsockoptString error:", bbr) } + if control != nil { + t.link.core.log.Debugln("Failed to set tcp_congestion_control to bbr for socket, Control error:", control) + } + + // Return nil because errors here are not considered fatal for the connection, it just means congestion control is suboptimal + return nil }