next up previous contents
Next: do_tcp_sendmsg Up: TCP Output Previous: TCP Output

 

tcp_sendmsg

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:

If the MSG_EOF flag is set, then we can set the PRU_SEND_EOF flag in the sock structure.

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:

When using MSG_EOF, there is no need for the programmer to call the connect function.

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.



Mark Stacey
Thu Apr 30 12:26:11 IST 1998