Re: Fragment flooding in 2.4.x/2.5.x

From: Trond Myklebust (trond.myklebust@fys.uio.no)
Date: Fri Jun 28 2002 - 03:22:50 EST


On Friday 28 June 2002 00:07, kuznet@ms2.inr.ac.ru wrote:

> I am saying absolutely seriously that there is nothing more stupid
> than preparation of skbs only to drop them and to return you EAGAIN.
> _Nothing_, do you hear this?

I hear, but you still haven't explained why? What exactly would trigger a
BUG() as you mentioned?

> Repeating the third time in hope you eventually read the mail to the end:
> >>>Better way exists. Just use forced sock_wmalloc instead of
> >>>sock_alloc_send_skb on non-blocking send of all the fragments
> >>>but the first.

I heard you the first time, and have been looking into it. However that still
does not address the problem of memory allocation failure (yes - I know you
said that is the same as network loss - I still don't think we need to
simulate that).
If I understand correctly, it also means that you have to estimate socket
buffer memory useage prior to actually entering the loop (something which is
impossible to do accurately). Attached is a patch that I hope you will
comment on (without too many expletives please ;-))...

> And, yes, until this is done, I have to be serious when saying
> that any application using nonblocking sockets have to use select()
> or even SIOCOUTQ. Your patch does not change anything in this.

sendmsg() + select() alone should suffice. Anybody using those 2 should be
able to expect optimal message output without the socket buffer getting
filled with junk data.

Cheers,
  Trond



-
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 : Sun Jun 30 2002 - 22:00:13 EST