mirror of
https://github.com/SagerNet/sing-tun.git
synced 2025-04-03 03:47:39 +03:00
Revert "Update udpant usages"
This commit is contained in:
parent
59a6bdc1fa
commit
091b5da950
5 changed files with 8 additions and 22 deletions
|
@ -34,7 +34,6 @@ type GVisor struct {
|
|||
logger logger.Logger
|
||||
stack *stack.Stack
|
||||
endpoint stack.LinkEndpoint
|
||||
udpForwarder *UDPForwarder
|
||||
}
|
||||
|
||||
type GVisorTun interface {
|
||||
|
@ -72,11 +71,9 @@ func (t *GVisor) Start() error {
|
|||
return err
|
||||
}
|
||||
ipStack.SetTransportProtocolHandler(tcp.ProtocolNumber, NewTCPForwarder(t.ctx, ipStack, t.handler).HandlePacket)
|
||||
udpForwarder := NewUDPForwarder(t.ctx, ipStack, t.handler, t.udpTimeout)
|
||||
ipStack.SetTransportProtocolHandler(udp.ProtocolNumber, udpForwarder.HandlePacket)
|
||||
ipStack.SetTransportProtocolHandler(udp.ProtocolNumber, NewUDPForwarder(t.ctx, ipStack, t.handler, t.udpTimeout).HandlePacket)
|
||||
t.stack = ipStack
|
||||
t.endpoint = linkEndpoint
|
||||
t.udpForwarder = udpForwarder
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -89,7 +86,6 @@ func (t *GVisor) Close() error {
|
|||
for _, endpoint := range t.stack.CleanupEndpoints() {
|
||||
endpoint.Abort()
|
||||
}
|
||||
t.udpForwarder.Close()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue