alexkirsz/dispatch

When an ethernet connection is active, the wifi connection stops working

Rosentti opened this issue · 4 comments

With Ethernet+WiFi (wlp1s0 addresses in use for proxy):

curl -x socks5://127.0.0.1:1080 http://api.ipify.org
(hangs)

With WiFi only (wlp1s0 addresses in use for proxy):

curl -x socks5://127.0.0.1:1080 http://api.ipify.org
85.XX.XX.XX

With Ethernet+Wifi (eno1 addresses in use for proxy):

curl -x socks5://127.0.0.1:1080 http://api.ipify.org
84.XXX.XXX.XXX

Using socks4 with any configuration results in curl: (97) Recv failure: Connection reset by peer.
Running on Arch Linux, have ethernet and wifi. Is this a kernel limitation or something wrong with rust's networking/this program?

Doesn't seem to be a limitation of the kernel:

curl --interface eno1 http://api.ipify.org
84.XXX.XXX.XXX
curl --interface wlp1s0 http://api.ipify.org
85.XX.XX.XX

cURL inhibits this behaviour too (only with specific ip, by interface name works as before):

curl --interface 192.168.0.106 http://api.ipify.org
84.XXX.XXX.XXX
curl --interface 192.168.172.224 http://api.ipify.org
(hangs)

Fixed myself. Will create PR soon.

I wanted to use your solution because I thought I might have the same problem as you.

So I compiled your source and :
image

It doesn't work on Windows because you're using a function that isn't implemented on Windows (check tokio TcpSocket doc), so I wouldn't recommend @alexkirsz to accept the PR #27 (You can use Conditional compilation to make it a Linux-only feature.)