From patchwork Mon Jun 23 13:26:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 32360 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 62D3E20540 for ; Mon, 23 Jun 2014 13:34:39 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id uz6sf23212788obc.8 for ; Mon, 23 Jun 2014 06:34:39 -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=EZ9StlH3tMdcgAbxqzsLQlJYlUxiXc5Zg1I16gYTRKA=; b=gVtxSyF2J3iF4APfKa4G1BVqImQiqxwghOBvmIX5HFeqlC1BzDuXEv05H3A1wH1Bo+ tufKDlx8pHD65+ETQ4L5cL3gAz79BbZ+rcl8Ehb9fx8mwleQSCZqE6DHVwv2MxTkC+T8 nFu5OkuxD15/uu78FDfv/hYAQqhAbGFRLHb7Zg8aDh5Frsk9dZT0ZSRaGUP2tc6eL8or usvvByesB9n+BDLgsLfTNPAwVa8feAlC+kvfVfQKQjmbXOlnZYphLRb6ilUyveXkL28u S9WEitGf4tiRHr1GdHkYkfFHZFw91Ws46GcZ77ENSZcd21Bd1he8a+ChlUfTWoetpXRT lgQg== X-Gm-Message-State: ALoCoQlh8RvT/he9hR2kMpw/sODlDhMOgUjLgtNwWHpG8nbeTstR3ZcV2WGQRtmwgJkEWrNitaSn X-Received: by 10.42.25.17 with SMTP id y17mr8710984icb.11.1403530478920; Mon, 23 Jun 2014 06:34:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.203 with SMTP id v69ls1856464qgd.6.gmail; Mon, 23 Jun 2014 06:34:38 -0700 (PDT) X-Received: by 10.220.105.136 with SMTP id t8mr19253506vco.13.1403530478829; Mon, 23 Jun 2014 06:34:38 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id c1si8996289vei.68.2014.06.23.06.34.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 06:34:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.180 as permitted sender) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jw12so6016369veb.25 for ; Mon, 23 Jun 2014 06:34:38 -0700 (PDT) X-Received: by 10.52.23.71 with SMTP id k7mr14317640vdf.27.1403530478732; Mon, 23 Jun 2014 06:34:38 -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 tc5csp131149vcb; Mon, 23 Jun 2014 06:34:38 -0700 (PDT) X-Received: by 10.140.29.139 with SMTP id b11mr30958568qgb.44.1403530478286; Mon, 23 Jun 2014 06:34:38 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l10si22736912qad.51.2014.06.23.06.34.38 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 23 Jun 2014 06:34:38 -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]:53563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz4OL-0005aj-TF for patch@linaro.org; Mon, 23 Jun 2014 09:34:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz4Gn-0003iQ-Gt for qemu-devel@nongnu.org; Mon, 23 Jun 2014 09:26:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wz4Gd-0001BU-L1 for qemu-devel@nongnu.org; Mon, 23 Jun 2014 09:26:49 -0400 Received: from afflict.kos.to ([92.243.29.197]:50455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz4Gd-0001Ac-D5 for qemu-devel@nongnu.org; Mon, 23 Jun 2014 09:26:39 -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 3B5E82657B; Mon, 23 Jun 2014 15:26:36 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 23 Jun 2014 16:26:22 +0300 Message-Id: <5c51fef54dc2515ae0cce6d1b0c07f18ed971230.1403529800.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: 92.243.29.197 Cc: Paul Burton Subject: [Qemu-devel] [PULL 07/19] 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.180 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;