blob: 9fa30fd2a398e3346203e8d334792d9710d6072c (
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
28
29
30
31
32
|
socket: 0.921
network: 0.791
device: 0.791
performance: 0.633
other: 0.571
graphic: 0.546
files: 0.439
vnc: 0.435
permissions: 0.403
boot: 0.360
PID: 0.292
KVM: 0.290
debug: 0.255
semantic: 0.011
socket type mapping wrong for mips app-level emulation
linux-user/syscall.c's do_socket function contains socket type remapping to work around the nonsensically-permuted MIPS socket types. However, it fails to account for the SOCK_NONBLOCK and SOCK_CLOEXEC flags that may be or'd onto the type. Thus, a call from the application such as:
socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)
will fail to have the type permutation performed, and will be passed to the system as:
socket(AF_INET, SOCK_DGRAM, IPPROTO_TCP)
resulting in EPROTONOSUPPORT.
To fix this, the flag bits should be masked off of the type before the permutation. They also need remapping themselves (since MIPS uses different values for these flags bits).
This should be fixed in QEMU 1.6.
|