]> Cypherpunks repositories - gostls13.git/commit
net: permit WriteMsgUDP to connected UDP sockets
authorNicolas S. Dade <nic.dade@gmail.com>
Thu, 5 Feb 2015 02:05:53 +0000 (18:05 -0800)
committerMikio Hara <mikioh.mikioh@gmail.com>
Tue, 10 Feb 2015 08:00:39 +0000 (08:00 +0000)
commit263405ea4ac29e2c70e6e0bd3793e54c60f3a305
tree5026dcbb952680cd978799b851146d362813b90a
parente810a079eb737bf5a0f74c225f6989b5b34d8165
net: permit WriteMsgUDP to connected UDP sockets

The sanity checks at the beginning of WriteMsgUDP were too
strict, and did not allow a case sendmsg(2) suppports: sending
to a connected UDP socket.

This fixes the sanity checks. Either the socket is unconnected,
and a destination addresses is required (what all existing callers
must have been doing), or the socket is connected and an explicit
destination address must not be used.

Fixes #9807

Change-Id: I08d4ec3c2bf830335c402acfc0680c841cfcec71
Reviewed-on: https://go-review.googlesource.com/3951
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
src/net/udp_test.go
src/net/udpsock_posix.go