netdev
[Top] [All Lists]

TCP: sendmsg/recvmsg/ioctl(SIOCINQ/SIOCOUTQ)

To: netdev@xxxxxxxxxxx
Subject: TCP: sendmsg/recvmsg/ioctl(SIOCINQ/SIOCOUTQ)
From: "James R. Leu" <jleu@xxxxxxxxxxxxxx>
Date: Thu, 11 Jan 2001 16:42:31 -0600
In-reply-to: <921FA59842C3D111BB2400A0C9498D0B9EB241@exchange03.rl.ac.uk>; from R.Dravid@rl.ac.uk on Thu, Jan 11, 2001 at 01:29:01PM -0000
Organization: none
References: <921FA59842C3D111BB2400A0C9498D0B9EB241@exchange03.rl.ac.uk>
Reply-to: jleu@xxxxxxxxxxxxxx
Sender: owner-netdev@xxxxxxxxxxx
It seems that TCPs recvmsg/sendmsg and ioctl for SIOCINQ/SIOCOUTQ do not
check to make sure the socket is connected.

I was unable to find a place that does check to make sure the socket is
connected before doig the above socket ops.

Is it adequte to do:

                if (sk->state != TCPF_ESTABLISHED)
                        return(-ENOTCONN);

to determin if a TCP socket is connected?  Where should this check (or another
more appropriate check) be made?

Thanks,
Jim

PS I'm working with 2.4.0
-- 
James R. Leu

<Prev in Thread] Current Thread [Next in Thread>