From patchwork Sun Jun 29 12:14:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 32669 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AF3D423577 for ; Sun, 29 Jun 2014 12:18:04 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id eb12sf44936844oac.3 for ; Sun, 29 Jun 2014 05:18:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=Ls0V5wrGGlPgWisfs7tC3+e1l/N+TUSDArYrw0hpPMM=; b=IQKybYMcvFh3wi7sUUrLRvgEPDK2eUmI5yg2lCAcL+JyugjO5aSP+E8JWo63WTUfvv os89XTmwVkpChRXrqph7/f6th7Xz2mpAX9sSvzrDSJfu4IUpWxDnZwF3y+DA10sCKcM0 iO99jIk5I0Oj7BMLqVnCT3HGL2WRrtjDy6xualQCp5Lw3YNmk3QMyErOs7RBH1R0DdLG EBONv+OxCokcQT0K+ntuq/6ZNr55RVKuXP2zKmxZFqJZ13oiqYwkn0cpxJKAwzX7ea74 QDkZfgpu+jdNXQ8OIJFmsGHQgMq6vehGHxkAdcP3sfwsJIqrfbBF7nE/vA63+lCV/3at 4MCw== X-Gm-Message-State: ALoCoQmhCQCC7lZqngMfaj8nR352JkSYDRMuLB9V9MqCGz2SrCAmO4p0ryvCYKOYwsRBG3VYZWPr X-Received: by 10.50.44.69 with SMTP id c5mr12702314igm.3.1404044284307; Sun, 29 Jun 2014 05:18:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.114 with SMTP id s105ls1135689qgs.64.gmail; Sun, 29 Jun 2014 05:18:04 -0700 (PDT) X-Received: by 10.52.17.129 with SMTP id o1mr26802771vdd.0.1404044284178; Sun, 29 Jun 2014 05:18:04 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id cb8si8828319vcb.36.2014.06.29.05.18.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 29 Jun 2014 05:18:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jx11so7182772veb.33 for ; Sun, 29 Jun 2014 05:18:04 -0700 (PDT) X-Received: by 10.221.4.66 with SMTP id ob2mr32054222vcb.28.1404044284096; Sun, 29 Jun 2014 05:18:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp72438vcb; Sun, 29 Jun 2014 05:18:03 -0700 (PDT) X-Received: by 10.140.104.106 with SMTP id z97mr39779996qge.21.1404044283546; Sun, 29 Jun 2014 05:18:03 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l9si20982701qaf.39.2014.06.29.05.18.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 29 Jun 2014 05:18:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:57513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1E3X-0000Ra-3B for patch@linaro.org; Sun, 29 Jun 2014 08:18:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1E0g-00049W-Gi for qemu-devel@nongnu.org; Sun, 29 Jun 2014 08:15:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1E0X-0000cL-Ta for qemu-devel@nongnu.org; Sun, 29 Jun 2014 08:15:06 -0400 Received: from [2001:4b98:dc0:45:216:3eff:fe3d:166f] (port=41886 helo=afflict.kos.to) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1E0X-0000az-NM for qemu-devel@nongnu.org; Sun, 29 Jun 2014 08:14:57 -0400 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id C3BC026560; Sun, 29 Jun 2014 14:14:55 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Sun, 29 Jun 2014 15:14:46 +0300 Message-Id: <82d0fe6b7a7384ed442b6a481ab33d442a06f5f1.1404041926.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2001:4b98:dc0:45:216:3eff:fe3d:166f Cc: Peter Maydell , Anthony Liguori , Paul Burton Subject: [Qemu-devel] [PULL v2 06/13] linux-user: support SO_PASSSEC setsockopt option 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Paul Burton Translate the SO_PASSSEC option to setsockopt to the host value & perform the syscall as expected, allowing use of the option by target programs. Signed-off-by: Paul Burton Signed-off-by: Riku Voipio --- linux-user/socket.h | 5 +++++ linux-user/syscall.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/linux-user/socket.h b/linux-user/socket.h index ae17959..4dacae6 100644 --- a/linux-user/socket.h +++ b/linux-user/socket.h @@ -63,6 +63,7 @@ #define TARGET_SO_PEERSEC 30 #define TARGET_SO_SNDBUFFORCE 31 #define TARGET_SO_RCVBUFFORCE 33 + #define TARGET_SO_PASSSEC 34 /** sock_type - Socket types * @@ -242,6 +243,10 @@ #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ + + #define TARGET_SO_PASSSEC 31 +#else + #define TARGET_SO_PASSSEC 34 #endif /* For setsockopt(2) */ diff --git a/linux-user/syscall.c b/linux-user/syscall.c index bdc60fe..3971cb5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1531,6 +1531,9 @@ set_timeout: case TARGET_SO_PASSCRED: optname = SO_PASSCRED; break; + case TARGET_SO_PASSSEC: + optname = SO_PASSSEC; + break; case TARGET_SO_TIMESTAMP: optname = SO_TIMESTAMP; break;