This commit is contained in:
世界 2026-06-29 10:04:52 +08:00
parent 1251022fce
commit aae2f0750c
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
4 changed files with 137 additions and 11 deletions

View file

@ -95,7 +95,7 @@ func (t *GVisor) Start() error {
}
ipStack.SetTransportProtocolHandler(tcp.ProtocolNumber, NewTCPForwarderWithLoopback(t.ctx, ipStack, t.handler, t.inet4LoopbackAddress, t.inet6LoopbackAddress, t.tun).HandlePacket)
ipStack.SetTransportProtocolHandler(udp.ProtocolNumber, NewUDPForwarder(t.ctx, ipStack, t.handler, t.udpTimeout).HandlePacket)
icmpForwarder := NewICMPForwarder(t.ctx, ipStack, t.handler, t.icmpTimeout)
icmpForwarder := NewICMPForwarder(t.ctx, ipStack, t.logger, t.handler, t.icmpTimeout)
icmpForwarder.SetLocalAddresses(t.inet4Address, t.inet6Address)
ipStack.SetTransportProtocolHandler(icmp.ProtocolNumber4, icmpForwarder.HandlePacket)
ipStack.SetTransportProtocolHandler(icmp.ProtocolNumber6, icmpForwarder.HandlePacket)