Fix gvisor icmp destination

This commit is contained in:
世界 2025-08-23 16:21:48 +08:00
parent 8dbb51cfb7
commit f46791bc0d
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
6 changed files with 24 additions and 27 deletions

View file

@ -5,16 +5,9 @@ package tun
import (
"github.com/sagernet/gvisor/pkg/tcpip"
"github.com/sagernet/gvisor/pkg/tcpip/header"
stack "github.com/sagernet/gvisor/pkg/tcpip/stack"
"github.com/sagernet/sing/common/buf"
"github.com/sagernet/gvisor/pkg/tcpip/stack"
)
type DirectRouteDestination interface {
WritePacket(packet *buf.Buffer) error
WritePacketBuffer(packetBuffer *stack.PacketBuffer) error
Close() error
}
func (w *NatWriter) RewritePacketBuffer(packetBuffer *stack.PacketBuffer) {
var bindAddr tcpip.Address
if packetBuffer.NetworkProtocolNumber == header.IPv4ProtocolNumber {