MSG_PEEK on TCP sockets was broken since commit b71d4477ea
from 06.03.2017: recv hung in an endless loop and tcp_recved() was called for peeked data
(which would result in a too large window advertised).
Aded TCP MSG_PEEK to socket unit tests
This commit adds CMSG infrastructure (currently used with recvmsg) and
the IP_PKTINFO socket option.
In order to use IP_PKTINFO, set LWIP_NETBUF_RECVINFO to 1
Unit test is added to verify this feature
This code is marked as dead when BUF_SZ is a multiple of 4 (current
situation with unit tests)
This hopefully fixes a -Wunreachable-code failure found by Travis CI
This migrates the sendmsg TCP test from socket examples (task #14408)
to socket unit tests
Additionally, this adds support for testing recvmsg, creating a TCP
test for both sendmsg/recvmsg (referred to as msgapi test)
This also makes a small change to msgapi UDP to clear the receive
buffer after verifying the previous datagram
Using {0} broke Travis CI even though this should be correct for
initializing struct msghdr (see example in Linxu man pages:
http://man7.org/linux/man-pages/man3/cmsg.3.html)
Just use memset for now which is the common approach in LwIP codebase
This converts the sendmsg test to use recvmsg for receiving, thus
exercising both sendmsg and recvmsg in a single test
This also adjusts the test naming to communicate all message APIs
(sendmsg/recvmsg) are being tested
This commit moves the sendmsg UDP test from socket examples to socket
unit tests
The test has been converted to send/receive on the loopback interface
and also test a connected sendmsg with NULL msg_name