diff --git a/cmd/yggstack/main.go b/cmd/yggstack/main.go index ef9d02a..6ffafd6 100644 --- a/cmd/yggstack/main.go +++ b/cmd/yggstack/main.go @@ -397,7 +397,7 @@ func main() { continue } udpSession := &UDPPacketConnSession{ - conn: &udpFwdConn, + conn: udpFwdConn, remoteAddr: remoteUdpAddr, } localUdpConnections.Store(remoteUdpAddrStr, udpSession) diff --git a/src/netstack/netstack.go b/src/netstack/netstack.go index 42fb056..9b723d9 100644 --- a/src/netstack/netstack.go +++ b/src/netstack/netstack.go @@ -86,12 +86,12 @@ func (s *YggdrasilNetstack) DialContext(ctx context.Context, network, address st } } -func (s *YggdrasilNetstack) DialTCP(addr *net.TCPAddr) (net.Conn, error) { +func (s *YggdrasilNetstack) DialTCP(addr *net.TCPAddr) (*gonet.TCPConn, error) { fa, pn, _ := convertToFullAddr(addr.IP, addr.Port) return gonet.DialTCP(s.stack, fa, pn) } -func (s *YggdrasilNetstack) DialUDP(addr *net.UDPAddr) (net.PacketConn, error) { +func (s *YggdrasilNetstack) DialUDP(addr *net.UDPAddr) (*gonet.UDPConn, error) { fa, pn, _ := convertToFullAddr(addr.IP, addr.Port) return gonet.DialUDP(s.stack, nil, &fa, pn) } @@ -101,7 +101,7 @@ func (s *YggdrasilNetstack) ListenTCP(addr *net.TCPAddr) (net.Listener, error) { return gonet.ListenTCP(s.stack, fa, pn) } -func (s *YggdrasilNetstack) ListenUDP(addr *net.UDPAddr) (net.PacketConn, error) { +func (s *YggdrasilNetstack) ListenUDP(addr *net.UDPAddr) (*gonet.UDPConn, error) { fa, pn, _ := convertToFullAddr(addr.IP, addr.Port) return gonet.DialUDP(s.stack, &fa, nil, pn) }