If the control message of IP_SENDSRCADDR did not fit into the socket
authorbluhm <bluhm@openbsd.org>
Tue, 21 Aug 2018 12:34:11 +0000 (12:34 +0000)
committerbluhm <bluhm@openbsd.org>
Tue, 21 Aug 2018 12:34:11 +0000 (12:34 +0000)
commit91f7777790c71b6f4a8b0851230592682bec0ef4
treea25e95da9baacbc7b5ec45be0bde6de934e57fa2
parentaee59ff9dbd23fdabec42359a377e4a49dabed86
If the control message of IP_SENDSRCADDR did not fit into the socket
buffer together with an UDP packet, sosend(9) returned EWOULDBLOCK.
As it is an persistent problem, EMSGSIZE is the correct error code.
Split the AF_UNIX case into a separate condition and do not change
its logic.  For atomic protocols, check that both data and control
message length fit into the socket buffer.
original bug report from Alexander Markert
discussed with jca@; OK vgross@
sys/kern/uipc_socket.c