]> Cypherpunks repositories - gostls13.git/commit
net: allow zero value destination address in WriteMsgUDPAddrPort
authordatabase64128 <free122448@hotmail.com>
Fri, 1 Aug 2025 16:42:27 +0000 (00:42 +0800)
committerSean Liao <sean@liao.dev>
Wed, 27 Aug 2025 08:05:25 +0000 (01:05 -0700)
commit49a2f3ed871c044eb093b16c09202b7dcd875878
tree128a07c0a3527eace99bec1adf0e8cb6347ab643
parentafc51ed007ad814fc11273f39055aeea71172557
net: allow zero value destination address in WriteMsgUDPAddrPort

The existing address validity checks already cover both connected and
non-connected sockets. Pass a nil sockaddr just like WriteMsgUDP, when
the address is zero value.

TestWriteToUDP is extended to cover the netip APIs.

Fixes #74841

Change-Id: I2708e7747e224958198fe7abb3fcd8d59bc5a88a
Reviewed-on: https://go-review.googlesource.com/c/go/+/692437
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Damien Neil <dneil@google.com>
src/net/ipsock_posix.go
src/net/net_fake.go
src/net/udpsock_posix.go
src/net/udpsock_test.go