Skip to content

Commit

Permalink
Try net.UDPCOnn
Browse files Browse the repository at this point in the history
Signed-off-by: Vasyl Gello <[email protected]>
  • Loading branch information
basilgello committed Jul 15, 2024
1 parent 9a9a70c commit 54b57a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/yggstack/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func main() {
go types.ReverseProxyUDP(mtu, &udpListenConn, &remoteUdpAddr, &udpFwdConn)
}

_, err := udpFwdConn.Write(udpBuffer[:bytesRead])
_, err = udpFwdConn.Write(udpBuffer[:bytesRead])
if err != nil {
logger.Debugf("Cannot write from yggdrasil to udp listener: %q", err)
continue
Expand Down
4 changes: 2 additions & 2 deletions src/netstack/netstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (s *YggdrasilNetstack) DialTCP(addr *net.TCPAddr) (net.Conn, error) {
return gonet.DialTCP(s.stack, fa, pn)
}

func (s *YggdrasilNetstack) DialUDP(addr *net.UDPAddr) (*gonet.UDPConn, error) {
func (s *YggdrasilNetstack) DialUDP(addr *net.UDPAddr) (net.UDPConn, error) {
fa, pn, _ := convertToFullAddr(addr.IP, addr.Port)
return gonet.DialUDP(s.stack, nil, &fa, pn)

Check failure on line 96 in src/netstack/netstack.go

View workflow job for this annotation

GitHub Actions / Build Windows/Linux/MacOS/FreeBSD/Android

cannot use gonet.DialUDP(s.stack, nil, &fa, pn) (value of type *gonet.UDPConn) as net.UDPConn value in return statement
}
Expand All @@ -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) (*gonet.UDPConn, error) {
func (s *YggdrasilNetstack) ListenUDP(addr *net.UDPAddr) (net.UDPConn, error) {
fa, pn, _ := convertToFullAddr(addr.IP, addr.Port)
return gonet.DialUDP(s.stack, &fa, nil, pn)

Check failure on line 106 in src/netstack/netstack.go

View workflow job for this annotation

GitHub Actions / Build Windows/Linux/MacOS/FreeBSD/Android

cannot use gonet.DialUDP(s.stack, &fa, nil, pn) (value of type *gonet.UDPConn) as net.UDPConn value in return statement
}

0 comments on commit 54b57a0

Please sign in to comment.