Skip to contentSkip to conversation

BUG: udp socket, getsockopt + setsockopt

DISCUSSION David Ashley 2 participants 2 messages Jan 30, 2002

lore
Share & tools
lore
#0 lore raw

I forgot to mention it doesn't act the same on my x86 desktop running linux. I don't recall what version. On my pc there is no trouble. Oh well.

Thanks--
Dave

Quoted 10 lines

When you set SO_RCVBUF with setsockopt, the kernel allocates twice the memory you set. This has something to do with BSD compatibility and storing internal kernel structures in the memory allocated for the recv buf. Try getsockopt after you setsockopt.

This is ostensibly a feature, not a bug. Search the linux-kernel archives for "so_rcvbuf" and "David Miller". Hint: you probably won't convince Dave to change his mind.

-VAL

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw

I'm not sure what version this change appeared. Also, your pc may have different default socket size settings. This command will show you both the max and default settings:

cat /proc/sys/net/core/?mem_*

(You can also set them in the usual way.)

-VAL

Quoted 19 lines · David Ashley

I forgot to mention it doesn't act the same on my x86 desktop running linux. I don't recall what version. On my pc there is no trouble. Oh well.

Thanks--
Dave

Quoted 10 lines

When you set SO_RCVBUF with setsockopt, the kernel allocates twice the memory you set. This has something to do with BSD compatibility and storing internal kernel structures in the memory allocated for the recv buf. Try getsockopt after you setsockopt.

This is ostensibly a feature, not a bug. Search the linux-kernel archives for "so_rcvbuf" and "David Miller". Hint: you probably won't convince Dave to change his mind.

-VAL

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/