stack: Add icmp timeout
This commit is contained in:
parent
568357315c
commit
bebc8d67f3
3 changed files with 7 additions and 2 deletions
|
|
@ -39,6 +39,7 @@ type System struct {
|
|||
inet4LoopbackAddress []netip.Addr
|
||||
inet6LoopbackAddress []netip.Addr
|
||||
udpTimeout time.Duration
|
||||
icmpTimeout time.Duration
|
||||
tcpListener net.Listener
|
||||
tcpListener6 net.Listener
|
||||
tcpPort uint16
|
||||
|
|
@ -69,6 +70,7 @@ func NewSystem(options StackOptions) (Stack, error) {
|
|||
inet4LoopbackAddress: options.TunOptions.Inet4LoopbackAddress,
|
||||
inet6LoopbackAddress: options.TunOptions.Inet6LoopbackAddress,
|
||||
udpTimeout: options.UDPTimeout,
|
||||
icmpTimeout: options.ICMPTimeout,
|
||||
handler: options.Handler,
|
||||
logger: options.Logger,
|
||||
inet4Prefixes: options.TunOptions.Inet4Address,
|
||||
|
|
@ -160,7 +162,7 @@ func (s *System) start() error {
|
|||
}
|
||||
s.tcpNat = NewNat(s.ctx, s.udpTimeout)
|
||||
s.udpNat = udpnat.New(s.handler, s.preparePacketConnection, s.udpTimeout, false)
|
||||
s.directNat = NewDirectRouteMapping(s.udpTimeout)
|
||||
s.directNat = NewDirectRouteMapping(s.icmpTimeout)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue