heiher / hev-socks5-tunnel

A high-performance tun2socks for Linux/Android/FreeBSD/macOS/iOS/WSL2 (IPv4/IPv6/TCP/UDP)
MIT License
669 stars 134 forks source link

udp forward #58

Closed hwk888 closed 8 months ago

hwk888 commented 9 months ago

During use, UDP will not be able to receive packets from the network card, and it will wait for data, but it is normal to use it on other platforms, and I don't know what will cause it.

The UDP log output stops here, the previous UDP protocol handshake is normal, and the UDP data does not receive any data by the forwarding time。

LOG_D ("%p socks5 udp recvfrom udp", self);

adat = HEV_SOCKS5 (self)->data;
alen = sizeof (struct sockaddr_in6);
rlen = hev_task_io_socket_recvfrom (hev_socks5_udp_get_fd (self), rbuf,
                                    sizeof (rbuf), 0, adat, &alen,
                                    task_io_yielder, self);
heiher commented 9 months ago

I need more information about how to reproduce it? and which platforms works and which not?

hwk888 commented 9 months ago

I tested on the armv7l platform, same platform, different router

heiher commented 9 months ago

Any more? No ideas for current info.

hwk888 commented 9 months ago

There is a problem with the ASUS AC1900c test, and the ASUS ax56u test is normal. The problematic test found that UDP was not successful

hwk888 commented 9 months ago

[2023-09-16 14:27:18] [D] 0x4014ebe8 socks5 session udp splice [2023-09-16 14:27:18] [D] 0x4014ebe8 socks5 udp sendto [2023-09-16 14:27:18] [D] 0x4014ebe8 socks5 udp write udp [2023-09-16 14:27:18] [D] 0x4014ebe8 socks5 session udp fwd f send [2023-09-16 14:27:18] [D] 0x4014ebe8 socks5 udp recvfrom udp log~

hwk888 commented 8 months ago

Does Linux kernel version 2.6.36.4brcmarm support? I run the program under the kernel, and UDP cannot be sent to the protocol stack,I found UDP to be problematic under this kernel and does not send and receive data properly

hwk888 commented 8 months ago

Excuse me, and I want to ask. How to start the lwip api/socket.c log, I tried several switches but could not start the module log

heiher commented 8 months ago

Does Linux kernel version 2.6.36.4brcmarm support? I run the program under the kernel, and UDP cannot be sent to the protocol stack,I found UDP to be problematic under this kernel and does not send and receive data properly

I'm not sure.

heiher commented 8 months ago

I suggest that you try using hev-socks5-tunnel with hev-socks5-server in UDP relay over TCP mode.

hwk888 commented 8 months ago

I have tried this method, and the result is the same. udp can't send and receive normally.

hwk888 commented 8 months ago

I'm running in the router system.

heiher commented 8 months ago

Could you paste the full logs of hev-socks5-tunnel and hev-socks5-server?

log config:

misc:
  log-file: stderr
  log-level: debug
hwk888 commented 8 months ago

OK