fix: fix dns on linux (#336)

* fix: fix dns on linux

* feat: detect run in Github action or not to setup DNS
This commit is contained in:
naison
2024-10-09 19:17:50 +08:00
committed by GitHub
parent e2757d3916
commit d141ec869b
912 changed files with 144260 additions and 5039 deletions

View File

@@ -15,15 +15,6 @@ import (
"gvisor.dev/gvisor/pkg/tcpip/transport/udp"
)
var _ stack.UniqueID = (*ID)(nil)
type ID struct {
}
func (i ID) UniqueID() uint64 {
return 1
}
func NewStack(ctx context.Context, tun stack.LinkEndpoint) *stack.Stack {
s := stack.New(stack.Options{
NetworkProtocols: []stack.NetworkProtocolFactory{
@@ -40,7 +31,6 @@ func NewStack(ctx context.Context, tun stack.LinkEndpoint) *stack.Stack {
// Enable raw sockets for users with sufficient
// privileges.
RawFactory: raw.EndpointFactory{},
UniqueID: ID{},
})
// set handler for TCP UDP ICMP
s.SetTransportProtocolHandler(tcp.ProtocolNumber, TCPForwarder(s))