Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is TCP_FASTOPEN supported on Debian 12 (bookworm) ? #3001

Open
Hacksign opened this issue Oct 9, 2024 · 0 comments
Open

Is TCP_FASTOPEN supported on Debian 12 (bookworm) ? #3001

Hacksign opened this issue Oct 9, 2024 · 0 comments

Comments

@Hacksign
Copy link

Hacksign commented Oct 9, 2024

What version of shadowsocks-libev are you using?

shadowsocks-libev 3.3.5

What operating system are you using?

# uname -an
Linux xxhost 6.1.0-25-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.106-3 (2024-08-26) x86_64 GNU/Linux
# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
# cat /proc/sys/net/ipv4/tcp_fastopen 
3

What did you do?

Setup a ss-server with --fast-open option.

What did you expect to see?

The ss-server would enable tcp fast open feature.

What did you see instead?

I saw a log:

ERROR: fast open is not supported on this platform

Question

Is Debian 12 bookworm support fast open or not ?

I investgated the source code of this project and found :

setfastopen(int fd)
{
    int s = 0;
#ifdef TCP_FASTOPEN
    if (fast_open) {
#if defined(__APPLE__) || defined(__MINGW32__)
        int opt = 1;
#else
        int opt = 5;
#endif
        s = setsockopt(fd, IPPROTO_TCP, TCP_FASTOPEN, &opt, sizeof(opt));

        if (s == -1) {
            if (errno == EPROTONOSUPPORT || errno == ENOPROTOOPT) {
                LOGE("fast open is not supported on this platform");
                fast_open = 0;
            } else {
                ERROR("setsockopt");
            }
        }
    }
#endif
    return s;
}

It seems the system call setsockopt gave the error result ? I guess this is the Debian system problem (?) ...

I run ss-server in docker container BTW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant