xjasonlyu / tun2socks

tun2socks - powered by gVisor TCP/IP stack
https://github.com/xjasonlyu/tun2socks/wiki
GNU General Public License v3.0
2.85k stars 404 forks source link

[Feature] socks5 failed to receive UDP multicast packets #243

Closed snltty closed 4 months ago

snltty commented 1 year ago

Description

我应该怎么做才能收到组播数据包呢,我调试了一下 image image 打印了log,但是 socks5 没有收到数据包

Is this feature related to a specific bug?

No response

Do you have a specific solution in mind?

No response

xjasonlyu commented 1 year ago

代理似乎本身也不支持组播的吧

snltty commented 1 year ago

如果能收到数据包,我socks5代理可以手动广播给所有连接

snltty commented 1 year ago

是本身就没处理这些包吗,还是说是我设置的问题

xjasonlyu commented 1 year ago

我记得默认会忽略组播这些的

snltty commented 1 year ago

或许可以做个参数开关,表示是否忽略这些组播

xjasonlyu commented 1 year ago

可以pr :)

snltty commented 1 year ago

go我看不太懂,不知道在哪处理,这就有点难了:)

snltty commented 1 year ago

image 输出日志这里,下面 pipePacket 好像已经处理了数据包,不是很看得懂

Mylodie commented 1 year ago

I have encountered the same problem and tried to solve it in a temporary solution. If pr is welcome, I will try to submit one. @xjasonlyu @snltty

xjasonlyu commented 1 year ago

@Mylodie PR is definitely welcome!

snltty commented 1 year ago

我的可以了,用了好像是2.4.1 还是2.4.0的版本,就能收到组播的包了 @Mylodie 判断是否广播地址,直接广播出去就好了 image

Mylodie commented 1 year ago

Oh, I am still preparing the PR to support multicast packets. But this is even more strange, since if the stack does not add the NIC to certain specific multicast groups, handleValidatedPacket will discard packets with multicast addresses as dest. Is v2.4.1 or v2.4.0 special? @xjasonlyu @snltty

xjasonlyu commented 1 year ago

Hi @snltty @Mylodie,

Feel free to test Amaindex’s PR #245 if it meets all your requirements.

snltty commented 1 year ago

OK,I will try that

gleesheffle commented 1 year ago

我的可以了,用了好像是2.4.1 还是2.4.0的版本,就能收到组播的包了 Mine is okay, with the version that seems to be 2.4.1 or 2.4.0, I can receive the multicast package @Mylodie 判断是否广播地址,直接广播出去就好了 Judge whether to broadcast the address or not, just broadcast it directly image

I have same problem in version 2.5.0 and solved it by falling back to version 2.4.1. It seems that version 2.5.0 contains some breaking changes.

Hi @snltty @Mylodie,

Feel free to test Amaindex’s PR #245 if it meets all your requirements.

Will this patch be merged into a future version? I am not familiar with golang so I don't know how to apply it @xjasonlyu

snltty commented 1 year ago

i use to 2.4.1

Amaindex commented 11 months ago

Hello @snltty @gleesheffle. Has anyone had a chance to try out this patch? Does it work well in your respective scenarios?

xjasonlyu commented 4 months ago

This issue might have been resolved already. Reopen it if needed.