[PATCH]: Set SOCK_DONE when TCP socket receives FIN

From: Jamie Lokier (jamie@shareable.org)
Date: Sun Jul 13 2003 - 21:41:00 EST


The SOCK_DONE flag is always clear and never set in 2.5.75. Yet there
is code which tests it, and if it's clear, will return -ENOTCONN.
Admittedly I am confused as to how this is not noticed :)

This small patch sets it where it looks like it was intended.
Please check.

Enjoy,
-- Jamie

diff -ur orig-2.5.75/net/ipv4/tcp_input.c build-2.5.75/net/ipv4/tcp_input.c
--- orig-2.5.75/net/ipv4/tcp_input.c 2003-07-12 17:57:38.000000000 +0100
+++ build-2.5.75/net/ipv4/tcp_input.c 2003-07-14 02:29:15.000000000 +0100
@@ -2373,7 +2373,7 @@
         tcp_schedule_ack(tp);
 
         sk->sk_shutdown |= RCV_SHUTDOWN;
- sock_reset_flag(sk, SOCK_DONE);
+ sock_set_flag(sk, SOCK_DONE);
 
         switch (sk->sk_state) {
                 case TCP_SYN_RECV:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 15 2003 - 22:00:49 EST