Skip to content

Commit

Permalink
Fix gVisor UDP 6to4 check
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Oct 3, 2023
1 parent 6cfee41 commit 3ae726d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stack_gvisor_udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (w *UDPBackWriter) WritePacket(packetBuffer *buf.Buffer, destination M.Sock
return E.Cause(os.ErrInvalid, "invalid destination")
} else if destination.IsIPv4() && w.sourceNetwork == header.IPv6ProtocolNumber {
destination = M.SocksaddrFrom(netip.AddrFrom16(destination.Addr.As16()), destination.Port)
} else if destination.IsIPv6() && (w.sourceNetwork == header.IPv4AddressSizeBits) {
} else if destination.IsIPv6() && (w.sourceNetwork == header.IPv4ProtocolNumber) {
return E.New("send IPv6 packet to IPv4 connection")
}

Expand Down

0 comments on commit 3ae726d

Please sign in to comment.