Skip to content

WireGuard inbound: Fix leaking session information between requests#4030

Merged
RPRX merged 3 commits intomainfrom
wg-fix
Nov 20, 2024
Merged

WireGuard inbound: Fix leaking session information between requests#4030
RPRX merged 3 commits intomainfrom
wg-fix

Conversation

@Fangliding
Copy link
Member

Fix #3948 #4025

我本来以为是设计缺陷,结果这竟然是故意的,wg入站在入站级别共享一系列session参数(s.info) 这些参数对于每个请求都应该是独立的 多个入站互相操作这些参数导致目标可能被不正确重置 暂时没看懂为什么这么做

@RPRX RPRX changed the title Wireguard inbound: Fix leaking session information between requests WireGuard inbound: Fix leaking session information between requests Nov 20, 2024
@RPRX RPRX merged commit 59e5d24 into main Nov 20, 2024
@Fangliding Fangliding deleted the wg-fix branch November 20, 2024 05:20
@solopasha
Copy link

solopasha commented Nov 23, 2024

I think this broke routing by tag.

This is how it used to look (v24.11.11):

xray[1122931]: 2024/11/22 18:35:40 from tcp:0.0.0.0:0 accepted tcp:****:80 [wireguard-in -> reality-ro]

And now (v24.11.21):

xray[1129149]: 2024/11/23 9:21:47 from tcp:0.0.0.0:0 accepted tcp:****:80 [reality-ro]

@itsmepetrov
Copy link

I can confirm, domain routing is broken now by this change, details: #4760

FYI @yuhan6665 @Fangliding

Copilot AI added a commit that referenced this pull request Jan 11, 2026
As identified in issue #4760, PR #4030 commented out lines that set
inbound and content tags from routing info before dispatch. This broke
domain-based routing for WireGuard connections.

The fix adds back these lines (with mutex-protected access) positioned
right before the Dispatch call, ensuring routing configuration is
properly passed for domain-based routing rules to work.

This addresses the feedback that uncommenting those lines fixes routing.

Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
it2konst pushed a commit to it2konst/gametunnel-core that referenced this pull request Mar 1, 2026
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

Successfully merging this pull request may close these issues.

wireguard inbound + vless outbound 偶尔连接错误的TCP

4 participants