Skip to content

Commit

Permalink
Correct TODO in udp_windows.go (#1433)
Browse files Browse the repository at this point in the history
These TODOs were not correct as x/net/ipv4 and x/net/ipv6 still don't
have Windows support.
  • Loading branch information
tmthrgd authored Mar 12, 2023
1 parent d83d31b commit e88948e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions udp_windows.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//go:build windows
// +build windows

// TODO(tmthrgd): Remove this Windows-specific code if go.dev/issue/7175 and
// go.dev/issue/7174 are ever fixed.

package dns

import "net"
Expand All @@ -15,7 +18,6 @@ func (s *SessionUDP) RemoteAddr() net.Addr { return s.raddr }

// ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a
// net.UDPAddr.
// TODO(fastest963): Once go1.10 is released, use ReadMsgUDP.
func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) {
n, raddr, err := conn.ReadFrom(b)
if err != nil {
Expand All @@ -25,12 +27,9 @@ func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) {
}

// WriteToSessionUDP acts just like net.UDPConn.WriteTo(), but uses a *SessionUDP instead of a net.Addr.
// TODO(fastest963): Once go1.10 is released, use WriteMsgUDP.
func WriteToSessionUDP(conn *net.UDPConn, b []byte, session *SessionUDP) (int, error) {
return conn.WriteTo(b, session.raddr)
}

// TODO(fastest963): Once go1.10 is released and we can use *MsgUDP methods
// use the standard method in udp.go for these.
func setUDPSocketOptions(*net.UDPConn) error { return nil }
func parseDstFromOOB([]byte, net.IP) net.IP { return nil }

0 comments on commit e88948e

Please sign in to comment.