Re: hashing functions

Mark Stacey (heathclf@skynet.csn.ul.ie)
Sun, 22 Feb 1998 14:32:09 +0000 (GMT)


So where abouts is a socket set up?

With T/TCP a socket is set up as normal with the socket command, but the
connect function isn't called, just a sendto function specifying a MSG_EOF
flag. If the function tcp_sendmsg() finds this flag, it calls
ttcp_connect() which is basically the same as the original tcp_connect()
function but without sending a SYN packet.

The function do_tcp_sendmsg() is then called which looks after the sending
of the data. Using tcpdump, I can see the first packet with the SYN, FIN
and data being sent out, followed by the receipt of a SYN, ACK (second
packet in a three way handshake), but the tcp_rcv() function bombs out on
this packet when the tcp_v4_lookup() code fails, and sends a reset.

I presume what's happening is that I'm missing out on something in the
setting up of the socket, something to do with the hash table. I am
actually calling the tcp_v4_rehash function whenever a change of state
occurs, I've even tried explicitly calling the tcp_v4_hash() function.. All
to no avail.

Any ideas as to where I'm going wrong.

Mark Stacey

... and that's my two cents.

knowledge, n.:
Things you believe.

On Fri, 20 Feb 1998, David S. Miller wrote:

> Date: Fri, 20 Feb 1998 20:52:12 +0000 (GMT)
> From: Mark Stacey <heathclf@skynet.csn.ul.ie>
>
> Can anyone tell me what this does and under what conditions the goto
> statement will be called (and what has to be done for the goto to be
> avoided):
>
> sk = __tcp_v4_lookup(th, saddr, th->source, daddr, th->dest, dev);
> if (!sk) {
> goto no_tcp_socket;
> }
>
> It's located in the ./net/ipv4/tcp_input.c file in the tcp_rcv function.
>
> It happens when a TCP packet arrives for no socket we know about in
> the system, it is therefore an erroneous packet and we must jump to
> no_tcp_socket where we send a reset back to the sender and discard the
> packet. We must do this to stay within the specifications of the TCP
> protocol.
>
> Later,
> David S. Miller
> davem@dm.cobaltmicro.com
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu