This function in the file: /usr/src/linux/net/ipv4/tcp.c is the TCP/IP suite function that handles the preparation for sending of packets. This function has to be able to recognise that the MSG_EOF flag has been passed. One of its error checking routines checks to see if the flags passed are known, this is modified to the following:
In its original implementation, the function only attempted to send data when its state was connected. A check is added to see if the MSG_EOF flag was passed, and if so, ignore the fact that the state isn't connected:
The implied connect is handled by the ttcp_connect() function. This is basically a copy of the tcp_connect() function without establishing contact. See appendix A.1.3 for the code for this function.