Re: select()/socket has problems under 2.2.x.

Andrea Arcangeli (andrea@e-mind.com)
Sat, 13 Feb 1999 02:35:27 +0100 (CET)


On Fri, 12 Feb 1999, Frederick (Rick) A Niles wrote:

>setsockopt getsockopt select() works?
>--------------------------------------------
> 1008 2016 No
> 1009 2018 Yes

You may give a try at this my patch I've done now (the first part is a
jiffy wrap fix I catched today and is unrelated).

Index: tcp_input.c
===================================================================
RCS file: /var/cvs/linux/net/ipv4/tcp_input.c,v
retrieving revision 1.1.2.8
diff -u -r1.1.2.8 tcp_input.c
--- tcp_input.c 1999/02/12 20:17:05 1.1.2.8
+++ linux/net/ipv4/tcp_input.c 1999/02/13 01:15:50
@@ -242,7 +242,7 @@
extern __inline__ int tcp_paws_discard(struct tcp_opt *tp, struct tcphdr *th, unsigned len)
{
/* ts_recent must be younger than 24 days */
- return (((jiffies - tp->ts_recent_stamp) >= PAWS_24DAYS) ||
+ return (((s32)(jiffies - tp->ts_recent_stamp) >= PAWS_24DAYS) ||
(((s32)(tp->rcv_tsval-tp->ts_recent) < 0) &&
/* Sorry, PAWS as specified is broken wrt. pure-ACKs -DaveM */
(len != (th->doff * 4))));
@@ -1728,7 +1728,7 @@
* if we are really having our buffer space abused we stop accepting
* new receive data.
*/
- if(atomic_read(&sk->rmem_alloc) < (sk->rcvbuf << 1))
+ if(atomic_read(&sk->rmem_alloc) <= sk->rcvbuf)
return 0;

/* Massive buffer overcommit. */

But I've only had a fast look, it's very late and I am not sure if it can
help.

tcp_data() (tcp_input.c) wakenup the select() but it will fail if
prune_queue() return < 0.

Andrea Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/