Message ID | 1446064846-12529-2-git-send-email-laurent@vivier.eu |
---|---|
State | New |
Headers | show |
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 4b4159d..7c724ab 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2089,6 +2089,12 @@ static abi_long do_socket(int domain, int type, int protocol) if (domain == PF_NETLINK) return -TARGET_EAFNOSUPPORT; + + if (domain == AF_PACKET || + (domain == AF_INET && type == SOCK_PACKET)) { + protocol = tswap16(protocol); + } + ret = get_errno(socket(domain, type, protocol)); if (ret >= 0) { ret = sock_flags_fixup(ret, target_type);