Messages in this thread | | | Subject | Re: Fw: Local Denial-of-Service attack against Linux | Date | Sun, 26 Mar 2000 21:12:43 +0800 (SGT) | From | (Alexey Kuznetosv) |
| |
Hello!
> But IMHO > * getsockopt(SNDBUF) should return 1/2 sk->sndbuf. > * sk->sndbuf should be initialized to 2*wmem_default.
You missed one thing: sk->sndbuf is a real value with well defined semantics. And the argument passed to SO_SNDBUF is a hint, there is no direct connection between them. All this mess with SO_*BUF is origined not in linux, essentially SO_*BUF is simply broken from the very beginning and was misused for years. F.e. setting sndbuf of 10 bytes on udp socket, bsd allows to send packet with payload of 10 bytes, not depending how much overhead is involved. Essentially, such sndbuf is fully useless.
So, we choose the following scheme:
setsockopt() produces some sk->sndbuf from hint given by user. User need not know anything about algorithm used by kernel. However, user wants to know what sk->sndbuf is really selected and does this with getsockopt(). Well, you could design whole array of socket options to control this engine more transparently and emulating BSD more closely, but you should remember that nobody needed this until now.
Alexey
- 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/
| |