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

Bug: When server has multi IPv6 addresses, only one will work. #911

Open
wits-fe opened this issue Mar 20, 2023 · 1 comment
Open

Bug: When server has multi IPv6 addresses, only one will work. #911

wits-fe opened this issue Mar 20, 2023 · 1 comment

Comments

@wits-fe
Copy link

wits-fe commented Mar 20, 2023

OS: CentOS 7
There are three IPv6 addresses, for example:

A: 2600::1
B: 2600::2
C: 2600::3

server side command:

server_linux_amd64 -t "127.0.0.1:4321" -l ":5432" -crypt none -mode fast3 -mtu 1280 -sndwnd 2560 -rcvwnd 2560 -ds 2 -ps 2 -nocomp -sockbuf 16777216

On client, it's all ok connect with IPv6 address C, but other two will fail.
When client connect with address A, log like this:

2023/03/20 06:48:24 remote address: [2400::11]:57442
2023/03/20 06:48:24 smux version: 1 on connection: [::]:5432 -> [2400::11]:57442
2023/03/20 06:48:24 remote address: [2400::11]:57438
2023/03/20 06:48:24 smux version: 1 on connection: [::]:5432 -> [2400::11]:57438
2023/03/20 06:48:24 stream opened in: [2400::11]:57442(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 remote address: [2400::11]:57439
2023/03/20 06:48:24 smux version: 1 on connection: [::]:5432 -> [2400::11]:57439
2023/03/20 06:48:24 stream opened in: [2400::11]:57438(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream opened in: [2400::11]:57439(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 remote address: [2400::11]:57437
2023/03/20 06:48:24 smux version: 1 on connection: [::]:5432 -> [2400::11]:57437
2023/03/20 06:48:24 remote address: [2400::11]:57440
2023/03/20 06:48:24 smux version: 1 on connection: [::]:5432 -> [2400::11]:57440
2023/03/20 06:48:24 stream opened in: [2400::11]:57437(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream opened in: [2400::11]:57440(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 remote address: [2400::11]:57441
2023/03/20 06:48:24 smux version: 1 on connection: [::]:5432 -> [2400::11]:57441
2023/03/20 06:48:24 stream opened in: [2400::11]:57441(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream opened in: [2400::11]:57438(5) out: 127.0.0.1:4321
2023/03/20 06:48:24 remote address: [2400::11]:57443
2023/03/20 06:48:24 smux version: 1 on connection: [::]:5432 -> [2400::11]:57443
2023/03/20 06:48:24 stream opened in: [2400::11]:57443(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 remote address: [2400::11]:57444
2023/03/20 06:48:24 smux version: 1 on connection: [::]:5432 -> [2400::11]:57444
2023/03/20 06:48:24 stream opened in: [2400::11]:57437(5) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream opened in: [2400::11]:57444(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream closed in: [2400::11]:57442(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream closed in: [2400::11]:57438(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream closed in: [2400::11]:57439(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream closed in: [2400::11]:57437(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream closed in: [2400::11]:57438(5) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream closed in: [2400::11]:57440(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream closed in: [2400::11]:57444(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream closed in: [2400::11]:57443(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream closed in: [2400::11]:57437(5) out: 127.0.0.1:4321
2023/03/20 06:48:24 stream closed in: [2400::11]:57441(3) out: 127.0.0.1:4321
2023/03/20 06:48:24 remote address: [2400::11]:50000
2023/03/20 06:48:24 smux version: 1 on connection: [::]:5432 -> [2400::11]:50000
2023/03/20 06:48:24 stream opened in: [2400::11]:50000(3) out: 127.0.0.1:4321
2023/03/20 06:48:25 remote address: [2400::11]:52781
2023/03/20 06:48:25 remote address: [2400::11]:52782
2023/03/20 06:48:25 smux version: 1 on connection: [::]:5432 -> [2400::11]:52782
2023/03/20 06:48:25 smux version: 1 on connection: [::]:5432 -> [2400::11]:52781
2023/03/20 06:48:25 stream opened in: [2400::11]:52782(3) out: 127.0.0.1:4321
2023/03/20 06:48:25 remote address: [2400::11]:52783
2023/03/20 06:48:25 smux version: 1 on connection: [::]:5432 -> [2400::11]:52783
2023/03/20 06:48:25 stream opened in: [2400::11]:52783(3) out: 127.0.0.1:4321
2023/03/20 06:48:25 stream opened in: [2400::11]:52781(3) out: 127.0.0.1:4321
2023/03/20 06:48:25 remote address: [2400::11]:52784
2023/03/20 06:48:25 smux version: 1 on connection: [::]:5432 -> [2400::11]:52784
2023/03/20 06:48:25 stream opened in: [2400::11]:52784(3) out: 127.0.0.1:4321
2023/03/20 06:48:26 remote address: [2400::11]:55246
2023/03/20 06:48:26 smux version: 1 on connection: [::]:5432 -> [2400::11]:55246
2023/03/20 06:48:26 stream opened in: [2400::11]:55246(3) out: 127.0.0.1:4321
2023/03/20 06:48:27 remote address: [2400::11]:64553
2023/03/20 06:48:27 smux version: 1 on connection: [::]:5432 -> [2400::11]:64553
2023/03/20 06:48:27 stream opened in: [2400::11]:64553(3) out: 127.0.0.1:4321
2023/03/20 06:48:28 remote address: [2400::11]:64048
2023/03/20 06:48:28 smux version: 1 on connection: [::]:5432 -> [2400::11]:64048
2023/03/20 06:48:28 stream opened in: [2400::11]:64048(3) out: 127.0.0.1:4321
2023/03/20 06:48:28 stream opened in: [2400::11]:50000(5) out: 127.0.0.1:4321
2023/03/20 06:48:28 stream opened in: [2400::11]:52781(5) out: 127.0.0.1:4321
2023/03/20 06:48:30 stream opened in: [2400::11]:52782(5) out: 127.0.0.1:4321
2023/03/20 06:48:30 stream opened in: [2400::11]:52783(5) out: 127.0.0.1:4321
2023/03/20 06:48:30 stream opened in: [2400::11]:52784(5) out: 127.0.0.1:4321
2023/03/20 06:48:35 stream opened in: [2400::11]:55246(5) out: 127.0.0.1:4321
2023/03/20 06:48:35 stream closed in: [2400::11]:50000(3) out: 127.0.0.1:4321
2023/03/20 06:48:35 stream closed in: [2400::11]:52784(3) out: 127.0.0.1:4321
2023/03/20 06:48:37 stream closed in: [2400::11]:64553(3) out: 127.0.0.1:4321
2023/03/20 06:48:38 stream closed in: [2400::11]:64048(3) out: 127.0.0.1:4321
2023/03/20 06:48:38 stream closed in: [2400::11]:50000(5) out: 127.0.0.1:4321

It didn't work, though.


Now if I use the following: ( listen to one certain IPv6 address )

server_linux_amd64 -t "127.0.0.1:4321" -l "[2600::1]:5333" -crypt none -mode fast3 -mtu 1280 -sndwnd 2560 -rcvwnd 2560 -ds 2 -ps 2 -nocomp -sockbuf 16777216

Then it works.

The problem is that it binds the port on all IPv6 address, but only one works.

Though it can be fixed by running more instances which listen to one IPv6 address, that will consume more memory.

@xtaci xtaci pinned this issue Mar 20, 2023
@woodlyer
Copy link

apernet/hysteria#592
hysteria has the same problem.

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

2 participants