diff --git a/cmd/run.go b/cmd/run.go index 31e0958..d5d1614 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -15,9 +15,9 @@ import ( "syscall" "time" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/pkg/fastrand" - "github.com/mzz2017/softwind/protocol/direct" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/pkg/fastrand" + "github.com/daeuniverse/softwind/protocol/direct" "gopkg.in/natefinch/lumberjack.v2" "github.com/daeuniverse/dae/cmd/internal" diff --git a/common/bitlist/bitlist.go b/common/bitlist/bitlist.go index 84aacc4..312bbe5 100644 --- a/common/bitlist/bitlist.go +++ b/common/bitlist/bitlist.go @@ -10,7 +10,7 @@ import ( "math/bits" "github.com/daeuniverse/dae/pkg/anybuffer" - "github.com/mzz2017/softwind/common" + "github.com/daeuniverse/softwind/common" ) // CompactBitList allows your units to be of arbitrary bit size. diff --git a/common/netutils/dns.go b/common/netutils/dns.go index 5aff984..ff11066 100644 --- a/common/netutils/dns.go +++ b/common/netutils/dns.go @@ -16,10 +16,10 @@ import ( "time" "github.com/daeuniverse/dae/common/consts" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/pkg/fastrand" + "github.com/daeuniverse/softwind/pool" dnsmessage "github.com/miekg/dns" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/pkg/fastrand" - "github.com/mzz2017/softwind/pool" ) var ( diff --git a/common/netutils/ip46.go b/common/netutils/ip46.go index 3d8ac90..3425dc6 100644 --- a/common/netutils/ip46.go +++ b/common/netutils/ip46.go @@ -12,8 +12,8 @@ import ( "net/netip" "sync" + "github.com/daeuniverse/softwind/netproxy" dnsmessage "github.com/miekg/dns" - "github.com/mzz2017/softwind/netproxy" "github.com/sirupsen/logrus" ) diff --git a/common/netutils/ip46_test.go b/common/netutils/ip46_test.go index 3f0b9d5..6d416bd 100644 --- a/common/netutils/ip46_test.go +++ b/common/netutils/ip46_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/mzz2017/softwind/protocol/direct" + "github.com/daeuniverse/softwind/protocol/direct" ) func TestResolveIp46(t *testing.T) { diff --git a/common/utils.go b/common/utils.go index 1d22a28..2fb438a 100644 --- a/common/utils.go +++ b/common/utils.go @@ -22,7 +22,7 @@ import ( "time" "unsafe" - "github.com/mzz2017/softwind/netproxy" + "github.com/daeuniverse/softwind/netproxy" internal "github.com/daeuniverse/dae/pkg/ebpf_internal" dnsmessage "github.com/miekg/dns" diff --git a/component/dns/upstream.go b/component/dns/upstream.go index 348db5a..17806d0 100644 --- a/component/dns/upstream.go +++ b/component/dns/upstream.go @@ -16,7 +16,7 @@ import ( "github.com/daeuniverse/dae/common/consts" "github.com/daeuniverse/dae/common/netutils" - "github.com/mzz2017/softwind/protocol/direct" + "github.com/daeuniverse/softwind/protocol/direct" ) var ( diff --git a/component/outbound/dialer/alive_dialer_set.go b/component/outbound/dialer/alive_dialer_set.go index cd732db..aed7809 100644 --- a/component/outbound/dialer/alive_dialer_set.go +++ b/component/outbound/dialer/alive_dialer_set.go @@ -13,7 +13,7 @@ import ( "time" "github.com/daeuniverse/dae/common/consts" - "github.com/mzz2017/softwind/pkg/fastrand" + "github.com/daeuniverse/softwind/pkg/fastrand" "github.com/sirupsen/logrus" ) diff --git a/component/outbound/dialer/block.go b/component/outbound/dialer/block.go index 77c5aaf..e3484e3 100644 --- a/component/outbound/dialer/block.go +++ b/component/outbound/dialer/block.go @@ -9,7 +9,7 @@ import ( "fmt" "net" - "github.com/mzz2017/softwind/netproxy" + "github.com/daeuniverse/softwind/netproxy" ) type blockDialer struct { diff --git a/component/outbound/dialer/connectivity_check.go b/component/outbound/dialer/connectivity_check.go index e7922ce..980e651 100644 --- a/component/outbound/dialer/connectivity_check.go +++ b/component/outbound/dialer/connectivity_check.go @@ -25,10 +25,10 @@ import ( "github.com/daeuniverse/dae/common/consts" "github.com/daeuniverse/dae/common/netutils" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/pkg/fastrand" + "github.com/daeuniverse/softwind/protocol/direct" dnsmessage "github.com/miekg/dns" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/pkg/fastrand" - "github.com/mzz2017/softwind/protocol/direct" "github.com/sirupsen/logrus" ) @@ -96,6 +96,13 @@ func (d *Dialer) mustGetCollection(typ *NetworkType) *collection { return d.collections[5] } case consts.L4ProtoStr_UDP: + // UDP share the DNS check result. + switch typ.IpVersion { + case consts.IpVersionStr_4: + return d.collections[2] + case consts.IpVersionStr_6: + return d.collections[3] + } } } panic("invalid param") diff --git a/component/outbound/dialer/dialer.go b/component/outbound/dialer/dialer.go index 849ec56..a9cd0a5 100644 --- a/component/outbound/dialer/dialer.go +++ b/component/outbound/dialer/dialer.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/mzz2017/softwind/netproxy" + "github.com/daeuniverse/softwind/netproxy" "github.com/sirupsen/logrus" ) diff --git a/component/outbound/dialer/direct.go b/component/outbound/dialer/direct.go index f316d69..5441a1f 100644 --- a/component/outbound/dialer/direct.go +++ b/component/outbound/dialer/direct.go @@ -1,8 +1,8 @@ package dialer import ( - "github.com/mzz2017/softwind/netproxy" - softwindDirect "github.com/mzz2017/softwind/protocol/direct" + "github.com/daeuniverse/softwind/netproxy" + softwindDirect "github.com/daeuniverse/softwind/protocol/direct" ) func NewDirectDialer(option *GlobalOption, fullcone bool) (netproxy.Dialer, *Property) { diff --git a/component/outbound/dialer/http/http.go b/component/outbound/dialer/http/http.go index 98d124d..3171057 100644 --- a/component/outbound/dialer/http/http.go +++ b/component/outbound/dialer/http/http.go @@ -8,8 +8,8 @@ import ( "github.com/daeuniverse/dae/common" "github.com/daeuniverse/dae/component/outbound/dialer" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/protocol/http" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/protocol/http" ) func init() { diff --git a/component/outbound/dialer/juicity/juicity.go b/component/outbound/dialer/juicity/juicity.go index 232175c..2dd9dd3 100644 --- a/component/outbound/dialer/juicity/juicity.go +++ b/component/outbound/dialer/juicity/juicity.go @@ -12,8 +12,8 @@ import ( "github.com/daeuniverse/dae/common" "github.com/daeuniverse/dae/component/outbound/dialer" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/protocol" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/protocol" ) func init() { diff --git a/component/outbound/dialer/register.go b/component/outbound/dialer/register.go index e9e57a5..213402a 100644 --- a/component/outbound/dialer/register.go +++ b/component/outbound/dialer/register.go @@ -11,8 +11,8 @@ import ( "strings" "github.com/daeuniverse/dae/common" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/protocol/direct" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/protocol/direct" ) type FromLinkCreator func(gOption *GlobalOption, nextDialer netproxy.Dialer, link string) (dialer netproxy.Dialer, property *Property, err error) diff --git a/component/outbound/dialer/shadowsocks/shadowsocks.go b/component/outbound/dialer/shadowsocks/shadowsocks.go index 89eeeff..b3870d0 100644 --- a/component/outbound/dialer/shadowsocks/shadowsocks.go +++ b/component/outbound/dialer/shadowsocks/shadowsocks.go @@ -11,9 +11,9 @@ import ( "github.com/daeuniverse/dae/common" "github.com/daeuniverse/dae/component/outbound/dialer" "github.com/daeuniverse/dae/component/outbound/transport/simpleobfs" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/protocol" - "github.com/mzz2017/softwind/protocol/shadowsocks" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/protocol" + "github.com/daeuniverse/softwind/protocol/shadowsocks" ) func init() { diff --git a/component/outbound/dialer/shadowsocksr/shadowsocksr.go b/component/outbound/dialer/shadowsocksr/shadowsocksr.go index 3751a3d..3d00080 100644 --- a/component/outbound/dialer/shadowsocksr/shadowsocksr.go +++ b/component/outbound/dialer/shadowsocksr/shadowsocksr.go @@ -10,11 +10,11 @@ import ( "github.com/daeuniverse/dae/common" "github.com/daeuniverse/dae/component/outbound/dialer" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/protocol" - "github.com/mzz2017/softwind/protocol/shadowsocks_stream" - "github.com/mzz2017/softwind/transport/shadowsocksr/obfs" - "github.com/mzz2017/softwind/transport/shadowsocksr/proto" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/protocol" + "github.com/daeuniverse/softwind/protocol/shadowsocks_stream" + "github.com/daeuniverse/softwind/transport/shadowsocksr/obfs" + "github.com/daeuniverse/softwind/transport/shadowsocksr/proto" ) func init() { diff --git a/component/outbound/dialer/socks/socks.go b/component/outbound/dialer/socks/socks.go index b458522..55f9803 100644 --- a/component/outbound/dialer/socks/socks.go +++ b/component/outbound/dialer/socks/socks.go @@ -8,8 +8,8 @@ import ( "strconv" "github.com/daeuniverse/dae/component/outbound/dialer" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/protocol/socks5" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/protocol/socks5" ) func init() { diff --git a/component/outbound/dialer/socks/socks_test.go b/component/outbound/dialer/socks/socks_test.go index d50da2e..a0de839 100644 --- a/component/outbound/dialer/socks/socks_test.go +++ b/component/outbound/dialer/socks/socks_test.go @@ -13,8 +13,8 @@ import ( "github.com/daeuniverse/dae/common/netutils" "github.com/daeuniverse/dae/component/outbound/dialer" + "github.com/daeuniverse/softwind/protocol/direct" dnsmessage "github.com/miekg/dns" - "github.com/mzz2017/softwind/protocol/direct" "github.com/sirupsen/logrus" ) diff --git a/component/outbound/dialer/trojan/trojan.go b/component/outbound/dialer/trojan/trojan.go index bc819bd..9ac7f4b 100644 --- a/component/outbound/dialer/trojan/trojan.go +++ b/component/outbound/dialer/trojan/trojan.go @@ -12,9 +12,9 @@ import ( "github.com/daeuniverse/dae/common" "github.com/daeuniverse/dae/component/outbound/dialer" "github.com/daeuniverse/dae/component/outbound/transport/ws" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/protocol" - "github.com/mzz2017/softwind/transport/grpc" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/protocol" + "github.com/daeuniverse/softwind/transport/grpc" ) func init() { diff --git a/component/outbound/dialer/tuic/tuic.go b/component/outbound/dialer/tuic/tuic.go index 4b372a8..c3af281 100644 --- a/component/outbound/dialer/tuic/tuic.go +++ b/component/outbound/dialer/tuic/tuic.go @@ -10,8 +10,8 @@ import ( "github.com/daeuniverse/dae/common" "github.com/daeuniverse/dae/component/outbound/dialer" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/protocol" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/protocol" ) func init() { diff --git a/component/outbound/dialer/v2ray/v2ray.go b/component/outbound/dialer/v2ray/v2ray.go index 61dfa14..3863ec2 100644 --- a/component/outbound/dialer/v2ray/v2ray.go +++ b/component/outbound/dialer/v2ray/v2ray.go @@ -12,12 +12,12 @@ import ( "github.com/daeuniverse/dae/component/outbound/dialer" "github.com/daeuniverse/dae/component/outbound/transport/tls" "github.com/daeuniverse/dae/component/outbound/transport/ws" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/protocol" + "github.com/daeuniverse/softwind/protocol/direct" + "github.com/daeuniverse/softwind/protocol/http" + "github.com/daeuniverse/softwind/transport/grpc" jsoniter "github.com/json-iterator/go" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/protocol" - "github.com/mzz2017/softwind/protocol/direct" - "github.com/mzz2017/softwind/protocol/http" - "github.com/mzz2017/softwind/transport/grpc" ) func init() { diff --git a/component/outbound/dialer_group.go b/component/outbound/dialer_group.go index 0fefff3..d25f2f1 100644 --- a/component/outbound/dialer_group.go +++ b/component/outbound/dialer_group.go @@ -12,7 +12,7 @@ import ( "github.com/daeuniverse/dae/common/consts" "github.com/daeuniverse/dae/component/outbound/dialer" - "github.com/mzz2017/softwind/netproxy" + "github.com/daeuniverse/softwind/netproxy" "github.com/sirupsen/logrus" ) @@ -210,6 +210,13 @@ func (d *DialerGroup) MustGetAliveDialerSet(typ *dialer.NetworkType) *dialer.Ali return d.aliveDialerSets[5] } case consts.L4ProtoStr_UDP: + // UDP share the DNS check result. + switch typ.IpVersion { + case consts.IpVersionStr_4: + return d.aliveDialerSets[2] + case consts.IpVersionStr_6: + return d.aliveDialerSets[3] + } } } panic("invalid param") @@ -228,10 +235,13 @@ func (g *DialerGroup) Select(networkType *dialer.NetworkType, strictIpVersion bo } if errors.Is(err, NoAliveDialerError) && len(g.Dialers) == 1 { // There is only one dialer in this group. Just choose it instead of return error. - return g._select(networkType, &DialerSelectionPolicy{ + if d, _, err = g._select(networkType, &DialerSelectionPolicy{ Policy: consts.DialerSelectionPolicy_Fixed, FixedIndex: 0, - }) + }); err != nil { + return nil, 0, err + } + return d, dialer.Timeout, nil } return nil, latency, err } diff --git a/component/outbound/dialer_group_test.go b/component/outbound/dialer_group_test.go index 43498f5..4ff110a 100644 --- a/component/outbound/dialer_group_test.go +++ b/component/outbound/dialer_group_test.go @@ -12,7 +12,7 @@ import ( "github.com/daeuniverse/dae/common/consts" "github.com/daeuniverse/dae/component/outbound/dialer" "github.com/daeuniverse/dae/pkg/logger" - "github.com/mzz2017/softwind/pkg/fastrand" + "github.com/daeuniverse/softwind/pkg/fastrand" ) const ( diff --git a/component/outbound/outbound.go b/component/outbound/outbound.go index 11c081f..d81be60 100644 --- a/component/outbound/outbound.go +++ b/component/outbound/outbound.go @@ -17,10 +17,10 @@ import ( _ "github.com/daeuniverse/dae/component/outbound/transport/simpleobfs" _ "github.com/daeuniverse/dae/component/outbound/transport/tls" _ "github.com/daeuniverse/dae/component/outbound/transport/ws" - _ "github.com/mzz2017/softwind/protocol/juicity" - _ "github.com/mzz2017/softwind/protocol/shadowsocks" - _ "github.com/mzz2017/softwind/protocol/trojanc" - _ "github.com/mzz2017/softwind/protocol/tuic" - _ "github.com/mzz2017/softwind/protocol/vless" - _ "github.com/mzz2017/softwind/protocol/vmess" + _ "github.com/daeuniverse/softwind/protocol/juicity" + _ "github.com/daeuniverse/softwind/protocol/shadowsocks" + _ "github.com/daeuniverse/softwind/protocol/trojanc" + _ "github.com/daeuniverse/softwind/protocol/tuic" + _ "github.com/daeuniverse/softwind/protocol/vless" + _ "github.com/daeuniverse/softwind/protocol/vmess" ) diff --git a/component/outbound/transport/simpleobfs/http.go b/component/outbound/transport/simpleobfs/http.go index 1520862..a208377 100644 --- a/component/outbound/transport/simpleobfs/http.go +++ b/component/outbound/transport/simpleobfs/http.go @@ -6,9 +6,9 @@ import ( "bytes" "encoding/base64" "fmt" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/pkg/fastrand" - "github.com/mzz2017/softwind/pool" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/pkg/fastrand" + "github.com/daeuniverse/softwind/pool" "io" "net/http" "strings" diff --git a/component/outbound/transport/simpleobfs/simpleobfs.go b/component/outbound/transport/simpleobfs/simpleobfs.go index 5c257fc..a9fe090 100644 --- a/component/outbound/transport/simpleobfs/simpleobfs.go +++ b/component/outbound/transport/simpleobfs/simpleobfs.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/daeuniverse/dae/component/outbound/dialer" - "github.com/mzz2017/softwind/netproxy" + "github.com/daeuniverse/softwind/netproxy" ) type ObfsType int diff --git a/component/outbound/transport/simpleobfs/tls.go b/component/outbound/transport/simpleobfs/tls.go index a448869..bf907dc 100644 --- a/component/outbound/transport/simpleobfs/tls.go +++ b/component/outbound/transport/simpleobfs/tls.go @@ -5,8 +5,8 @@ package simpleobfs import ( "bytes" "encoding/binary" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/pkg/fastrand" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/pkg/fastrand" "io" "sync" "time" diff --git a/component/outbound/transport/tls/tls.go b/component/outbound/transport/tls/tls.go index 0f9906e..54b9b57 100644 --- a/component/outbound/transport/tls/tls.go +++ b/component/outbound/transport/tls/tls.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/daeuniverse/dae/component/outbound/dialer" - "github.com/mzz2017/softwind/netproxy" + "github.com/daeuniverse/softwind/netproxy" utls "github.com/refraction-networking/utls" ) diff --git a/component/outbound/transport/ws/ws.go b/component/outbound/transport/ws/ws.go index 96ec8b1..e165a95 100644 --- a/component/outbound/transport/ws/ws.go +++ b/component/outbound/transport/ws/ws.go @@ -10,8 +10,8 @@ import ( "strings" "github.com/daeuniverse/dae/component/outbound/dialer" + "github.com/daeuniverse/softwind/netproxy" "github.com/gorilla/websocket" - "github.com/mzz2017/softwind/netproxy" ) // Ws is a base Ws struct diff --git a/component/sniffing/internal/quicutils/cipher.go b/component/sniffing/internal/quicutils/cipher.go index 8de6248..c5603ad 100644 --- a/component/sniffing/internal/quicutils/cipher.go +++ b/component/sniffing/internal/quicutils/cipher.go @@ -11,7 +11,7 @@ import ( "crypto/sha256" "encoding/binary" "github.com/daeuniverse/dae/common" - "github.com/mzz2017/softwind/pool" + "github.com/daeuniverse/softwind/pool" "golang.org/x/crypto/hkdf" "io" ) diff --git a/component/sniffing/internal/quicutils/hkdf.go b/component/sniffing/internal/quicutils/hkdf.go index f6f627c..312125b 100644 --- a/component/sniffing/internal/quicutils/hkdf.go +++ b/component/sniffing/internal/quicutils/hkdf.go @@ -4,7 +4,7 @@ package quicutils import ( "encoding/binary" - "github.com/mzz2017/softwind/pool" + "github.com/daeuniverse/softwind/pool" "golang.org/x/crypto/hkdf" "hash" "io" diff --git a/component/sniffing/internal/quicutils/relocation.go b/component/sniffing/internal/quicutils/relocation.go index 237831a..2b8c9ea 100644 --- a/component/sniffing/internal/quicutils/relocation.go +++ b/component/sniffing/internal/quicutils/relocation.go @@ -7,7 +7,7 @@ package quicutils import ( "fmt" - "github.com/mzz2017/softwind/pool" + "github.com/daeuniverse/softwind/pool" "io/fs" "sort" ) diff --git a/component/sniffing/quic.go b/component/sniffing/quic.go index 1d3c176..654e3cd 100644 --- a/component/sniffing/quic.go +++ b/component/sniffing/quic.go @@ -10,7 +10,7 @@ import ( "io/fs" "github.com/daeuniverse/dae/component/sniffing/internal/quicutils" - "github.com/mzz2017/softwind/pool" + "github.com/daeuniverse/softwind/pool" ) const ( diff --git a/component/sniffing/sniffing_bench_test.go b/component/sniffing/sniffing_bench_test.go index 33a8332..b7c8b84 100644 --- a/component/sniffing/sniffing_bench_test.go +++ b/component/sniffing/sniffing_bench_test.go @@ -10,7 +10,7 @@ import ( "github.com/daeuniverse/dae/common" "testing" - "github.com/mzz2017/softwind/pkg/fastrand" + "github.com/daeuniverse/softwind/pkg/fastrand" ) var ( diff --git a/control/control_plane.go b/control/control_plane.go index 938c76e..32a177a 100644 --- a/control/control_plane.go +++ b/control/control_plane.go @@ -32,11 +32,11 @@ import ( "github.com/daeuniverse/dae/config" "github.com/daeuniverse/dae/pkg/config_parser" internal "github.com/daeuniverse/dae/pkg/ebpf_internal" + "github.com/daeuniverse/softwind/pool" + "github.com/daeuniverse/softwind/protocol/direct" + "github.com/daeuniverse/softwind/transport/grpc" dnsmessage "github.com/miekg/dns" "github.com/mohae/deepcopy" - "github.com/mzz2017/softwind/pool" - "github.com/mzz2017/softwind/protocol/direct" - "github.com/mzz2017/softwind/transport/grpc" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/control/dns_control.go b/control/dns_control.go index e3d7d0b..2470891 100644 --- a/control/dns_control.go +++ b/control/dns_control.go @@ -25,11 +25,11 @@ import ( "github.com/daeuniverse/dae/component/dns" "github.com/daeuniverse/dae/component/outbound" "github.com/daeuniverse/dae/component/outbound/dialer" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/pkg/fastrand" + "github.com/daeuniverse/softwind/pool" dnsmessage "github.com/miekg/dns" "github.com/mohae/deepcopy" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/pkg/fastrand" - "github.com/mzz2017/softwind/pool" "github.com/sirupsen/logrus" ) @@ -543,7 +543,7 @@ func (c *DnsController) dialSend(invokingDepth int, req *udpRequest, data []byte networkType := &dialer.NetworkType{ L4Proto: dialArgument.l4proto, IpVersion: dialArgument.ipversion, - IsDns: true, // UDP relies on DNS check result. + IsDns: true, } // Dial and send. diff --git a/control/tcp.go b/control/tcp.go index d491943..7c84762 100644 --- a/control/tcp.go +++ b/control/tcp.go @@ -17,8 +17,8 @@ import ( "github.com/daeuniverse/dae/common/consts" "github.com/daeuniverse/dae/component/outbound/dialer" "github.com/daeuniverse/dae/component/sniffing" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/pkg/zeroalloc/io" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/pkg/zeroalloc/io" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) diff --git a/control/udp.go b/control/udp.go index c05f45e..1a7d72a 100644 --- a/control/udp.go +++ b/control/udp.go @@ -21,8 +21,8 @@ import ( "github.com/daeuniverse/dae/component/outbound/dialer" "github.com/daeuniverse/dae/component/sniffing" internal "github.com/daeuniverse/dae/pkg/ebpf_internal" + "github.com/daeuniverse/softwind/pkg/zeroalloc/buffer" dnsmessage "github.com/miekg/dns" - "github.com/mzz2017/softwind/pkg/zeroalloc/buffer" "github.com/sirupsen/logrus" ) @@ -175,7 +175,7 @@ func (c *ControlPlane) handlePkt(lConn *net.UDPConn, data []byte, src, pktDst, r networkType := &dialer.NetworkType{ L4Proto: consts.L4ProtoStr_UDP, IpVersion: consts.IpVersionFromAddr(realDst.Addr()), - IsDns: true, // UDP relies on DNS check result. + IsDns: false, } // Get outbound. outboundIndex := consts.OutboundIndex(routingResult.Outbound) diff --git a/control/udp_endpoint.go b/control/udp_endpoint.go index 82e07da..16aa9ca 100644 --- a/control/udp_endpoint.go +++ b/control/udp_endpoint.go @@ -15,8 +15,8 @@ import ( "github.com/daeuniverse/dae/common/consts" "github.com/daeuniverse/dae/component/outbound" "github.com/daeuniverse/dae/component/outbound/dialer" - "github.com/mzz2017/softwind/netproxy" - "github.com/mzz2017/softwind/pool" + "github.com/daeuniverse/softwind/netproxy" + "github.com/daeuniverse/softwind/pool" ) type UdpHandler func(data []byte, from netip.AddrPort) error diff --git a/go.mod b/go.mod index a2c2eef..6372918 100644 --- a/go.mod +++ b/go.mod @@ -8,11 +8,11 @@ require ( github.com/bits-and-blooms/bloom/v3 v3.5.0 github.com/cilium/ebpf v0.11.0 github.com/daeuniverse/dae-config-dist/go/dae_config v0.0.0-20230604120805-1c27619b592d + github.com/daeuniverse/softwind v0.0.0-20230805041143-2db4e28c8922 github.com/gorilla/websocket v1.5.0 github.com/json-iterator/go v1.1.12 github.com/miekg/dns v1.1.55 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/mzz2017/softwind v0.0.0-20230803152605-5f1f6bc06934 github.com/okzk/sdnotify v0.0.0-20180710141335-d9becc38acbd github.com/safchain/ethtool v0.3.0 github.com/sirupsen/logrus v1.9.3 @@ -34,9 +34,9 @@ require ( github.com/golang/mock v1.6.0 // indirect github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 // indirect github.com/klauspost/compress v1.16.7 // indirect - github.com/mzz2017/quic-go v0.0.0-20230731153658-2aabc7c97220 // indirect + github.com/mzz2017/quic-go v0.0.0-20230805032040-5e9a02f54eac // indirect github.com/onsi/ginkgo/v2 v2.11.0 // indirect - github.com/quic-go/qtls-go1-20 v0.3.0 // indirect + github.com/quic-go/qtls-go1-20 v0.3.1 // indirect golang.org/x/mod v0.12.0 // indirect golang.org/x/net v0.12.0 // indirect golang.org/x/tools v0.11.0 // indirect @@ -70,7 +70,7 @@ require ( google.golang.org/grpc v1.56.2 // indirect ) -// replace github.com/mzz2017/softwind => ../softwind +// replace github.com/daeuniverse/softwind => ../softwind // replace github.com/metacubex/quic-go => ../quic-go diff --git a/go.sum b/go.sum index 58e5311..116f7e8 100644 --- a/go.sum +++ b/go.sum @@ -13,6 +13,8 @@ github.com/cilium/ebpf v0.11.0/go.mod h1:WE7CZAnqOL2RouJ4f1uyNhqr2P4CCvXFIqdRDUg github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/daeuniverse/dae-config-dist/go/dae_config v0.0.0-20230604120805-1c27619b592d h1:hnC39MjR7xt5kZjrKlef7DXKFDkiX8MIcDXYC/6Jf9Q= github.com/daeuniverse/dae-config-dist/go/dae_config v0.0.0-20230604120805-1c27619b592d/go.mod h1:VGWGgv7pCP5WGyHGUyb9+nq/gW0yBm+i/GfCNATOJ1M= +github.com/daeuniverse/softwind v0.0.0-20230805041143-2db4e28c8922 h1:TQkiCTLMY82prw7vfGqOtSCWOuX9MvnCa3g6ufvPgxg= +github.com/daeuniverse/softwind v0.0.0-20230805041143-2db4e28c8922/go.mod h1:hL69hHFjobbgKxTJ5cknnuZT1DCglxdl30uJ3dS8nco= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -89,10 +91,8 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/mzz2017/disk-bloom v1.0.1 h1:rEF9MiXd9qMW3ibRpqcerLXULoTgRlM21yqqJl1B90M= github.com/mzz2017/disk-bloom v1.0.1/go.mod h1:JLHETtUu44Z6iBmsqzkOtFlRvXSlKnxjwiBRDapizDI= -github.com/mzz2017/quic-go v0.0.0-20230731153658-2aabc7c97220 h1:StI6iNucfDVrm54yhrHL0Dr1vKC1nBqkok2Itkypvdk= -github.com/mzz2017/quic-go v0.0.0-20230731153658-2aabc7c97220/go.mod h1:+8o4sdYYZCkNfMGiP3oKstpdHeSDFJy84A68evIzhw4= -github.com/mzz2017/softwind v0.0.0-20230803152605-5f1f6bc06934 h1:IAaVbSfNiYP/TuJ4n686SeAwcs+PMvKdzJM5R4Y1rhM= -github.com/mzz2017/softwind v0.0.0-20230803152605-5f1f6bc06934/go.mod h1:TopiWHnL2ty4V4AkNM1nNVdbLlASWdQqploagf4tcKc= +github.com/mzz2017/quic-go v0.0.0-20230805032040-5e9a02f54eac h1:luSUVeRYonUjk7Pxx8zViDj9Vpf42DZmfR/CbQcXKt0= +github.com/mzz2017/quic-go v0.0.0-20230805032040-5e9a02f54eac/go.mod h1:DBA25b2LoPhrfSzOPE8KcDOicysx00qvvnqe0BpA8DQ= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -109,8 +109,8 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/quic-go/qtls-go1-20 v0.3.0 h1:NrCXmDl8BddZwO67vlvEpBTwT89bJfKYygxv4HQvuDk= -github.com/quic-go/qtls-go1-20 v0.3.0/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= +github.com/quic-go/qtls-go1-20 v0.3.1 h1:O4BLOM3hwfVF3AcktIylQXyl7Yi2iBNVy5QsV+ySxbg= +github.com/quic-go/qtls-go1-20 v0.3.1/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= github.com/refraction-networking/utls v1.3.2 h1:o+AkWB57mkcoW36ET7uJ002CpBWHu0KPxi6vzxvPnv8= github.com/refraction-networking/utls v1.3.2/go.mod h1:fmoaOww2bxzzEpIKOebIsnBvjQpqP7L2vcm/9KUfm/E= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= diff --git a/pkg/trie/trie.go b/pkg/trie/trie.go index 10b2348..638fd68 100644 --- a/pkg/trie/trie.go +++ b/pkg/trie/trie.go @@ -5,7 +5,7 @@ package trie import ( "fmt" - "github.com/mzz2017/softwind/pkg/zeroalloc/buffer" + "github.com/daeuniverse/softwind/pkg/zeroalloc/buffer" "math/bits" "net/netip" "sort"