From patchwork Mon Jan 11 05:58:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 565652 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46B31140772 for ; Mon, 11 Jan 2016 17:00:02 +1100 (AEDT) Received: from localhost ([::1]:51791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIVWK-0002IO-Ct for incoming@patchwork.ozlabs.org; Mon, 11 Jan 2016 01:00:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIVW5-0001zQ-S6 for qemu-devel@nongnu.org; Mon, 11 Jan 2016 00:59:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIVW2-00071A-Lt for qemu-devel@nongnu.org; Mon, 11 Jan 2016 00:59:45 -0500 Received: from out21.biz.mail.alibaba.com ([205.204.114.132]:49758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIVW2-00070C-73 for qemu-devel@nongnu.org; Mon, 11 Jan 2016 00:59:42 -0500 X-Alimail-AntiSpam: AC=CONTINUE; BC=0.1905523|-1; FP=0|0|0|0|0|-1|-1|-1; HT=e01l04377; MF=chengang@emindsoft.com.cn; NM=1; PH=DS; RN=8; RT=7; SR=0; TI=SMTPD_----4RF.f0a_1452491961; Received: from localhost.localdomain(mailfrom:chengang@emindsoft.com.cn ip:36.110.17.42) by smtp.aliyun-inc.com(10.147.36.221); Mon, 11 Jan 2016 13:59:28 +0800 From: chengang@emindsoft.com.cn To: riku.voipio@iki.fi, laurent@vivier.eu Date: Mon, 11 Jan 2016 13:58:50 +0800 Message-Id: <1452491930-10210-1-git-send-email-chengang@emindsoft.com.cn> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 205.204.114.132 Cc: peter.maydell@linaro.org, Chen Gang , Chen Gang , qemu-devel@nongnu.org, rth@twiddle.net Subject: [Qemu-devel] [PATCH] linux-user/syscall.c: Use SOL_SOCKET instead of level for setsockopt() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Chen Gang In this case, level is TARGET_SOL_SOCKET, but we need SOL_SOCKET for setsockopt(). Signed-off-by: Chen Gang Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 95b1762..44485f2 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1596,7 +1596,8 @@ set_timeout: addr_ifname = alloca(IFNAMSIZ); memcpy(addr_ifname, dev_ifname, optlen); addr_ifname[optlen] = 0; - ret = get_errno(setsockopt(sockfd, level, optname, addr_ifname, optlen)); + ret = get_errno(setsockopt(sockfd, SOL_SOCKET, optname, + addr_ifname, optlen)); unlock_user (dev_ifname, optval_addr, 0); return ret; }