mirror of
https://github.com/fosrl/newt.git
synced 2026-02-08 05:56:40 +00:00
Fix some ipv4 in v6 issues
This commit is contained in:
@@ -371,6 +371,10 @@ func (s *WireGuardService) runDirectUDPRelay(listener net.PacketConn) {
|
||||
var srcAddrPort netip.AddrPort
|
||||
if udpAddr, ok := remoteAddr.(*net.UDPAddr); ok {
|
||||
srcAddrPort = udpAddr.AddrPort()
|
||||
// Unmap IPv4-in-IPv6 addresses to ensure consistency with parsed endpoints
|
||||
if srcAddrPort.Addr().Is4In6() {
|
||||
srcAddrPort = netip.AddrPortFrom(srcAddrPort.Addr().Unmap(), srcAddrPort.Port())
|
||||
}
|
||||
} else {
|
||||
logger.Debug("Unexpected address type in relay: %T", remoteAddr)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user