1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-14 19:41:51 +00:00

Update V2Ray MPTCP patch

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-08-30 21:08:57 +02:00
parent 84849238a8
commit d5b8e6751f

View file

@ -2921,3 +2921,47 @@ index 5b03acb7e..ff62bc2fa 100644
}
var (
From c9306fdb1886424f186680acbc5f889319f2dadd Mon Sep 17 00:00:00 2001
From: Luo Chongjun <luochongjun@gl-inet.com>
Date: Thu, 3 Aug 2023 17:09:55 +0800
Subject: [PATCH] fix mptcp dial
---
transport/internet/system_dialer.go | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/transport/internet/system_dialer.go b/transport/internet/system_dialer.go
index 6d1ef739..a7ebf75c 100644
--- a/transport/internet/system_dialer.go
+++ b/transport/internet/system_dialer.go
@@ -77,14 +77,6 @@ func (d *DefaultSystemDialer) Dial(ctx context.Context, src net.Address, dest ne
dialer.Control = func(network, address string, c syscall.RawConn) error {
return c.Control(func(fd uintptr) {
if sockopt != nil {
- if dest.Network == net.Network_TCP && sockopt.Mptcp {
- if dialer.MultipathTCP() {
- newError("Dialer MultipathTCP is enable").WriteToLog(session.ExportIDToError(ctx))
- } else {
- newError("Dialer MultipathTCP is disable,we are enable it").WriteToLog(session.ExportIDToError(ctx))
- dialer.SetMultipathTCP(true) // 主动启用mptcp
- }
- }
if err := applyOutboundSocketOptions(network, address, fd, sockopt); err != nil {
newError("failed to apply socket options").Base(err).WriteToLog(session.ExportIDToError(ctx))
}
@@ -104,6 +96,15 @@ func (d *DefaultSystemDialer) Dial(ctx context.Context, src net.Address, dest ne
}
}
+ if sockopt != nil && dest.Network == net.Network_TCP && sockopt.Mptcp {
+ if dialer.MultipathTCP() {
+ newError("Dialer MultipathTCP is enable").WriteToLog(session.ExportIDToError(ctx))
+ } else {
+ newError("Dialer MultipathTCP is disable,we are enable it").WriteToLog(session.ExportIDToError(ctx))
+ dialer.SetMultipathTCP(true) // 主动启用mptcp
+ }
+ }
+
return dialer.DialContext(ctx, dest.Network.SystemString(), dest.NetAddr())
}