blob: e4b977fee02d3ce6f1554f5912309b7431ddae0b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
socket: 0.815
mistranslation: 0.768
semantic: 0.637
device: 0.551
other: 0.477
network: 0.424
instruction: 0.374
boot: 0.362
graphic: 0.355
vnc: 0.192
KVM: 0.149
assembly: 0.049
linux-user emulation of setsockopt ignores optlen
setsockopt always treats the argument as a 4-byte int. This breaks timeout options (for which it's an 8- or 16-byte timeval structure, depending on word size) and possibly other socket options. int is probably a safe default, but options whose values are other types need special-case conversion code.
Agreed; we would ideally be more careful to return ENOTSUP for options we don't know we handle correctly. It would be useful if you said which particular options you were interested in and provided a test case...
I mentioned the timeout options (send/receive timeout) which are the
ones I was interested in.
We fixed our setsockopt emulation to correctly convert timeval parameters for SO_RCVTIMEO and SO_SNDTIMEO back in 2013.
|