From patchwork Thu Feb 4 15:39:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 376287 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp1394857jah; Thu, 4 Feb 2021 07:44:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyacSV+FVeO86nnCziAlaRHtaOn6z+vEVYhbgyOSdPJ4/8PCMc8dGWMPwKY50Ijdb/GxoAz X-Received: by 2002:a25:903:: with SMTP id 3mr12664000ybj.507.1612453494254; Thu, 04 Feb 2021 07:44:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612453494; cv=none; d=google.com; s=arc-20160816; b=tQxEIA/FK+UXXZVfm98e/yDwNZxpsmUt4N0CCr6kgN3E9o6XKA7lRB8w0+G8XRuHCr sF2wLSfvq415/uKwgXFQ8xWKmiHJ5Bsu1u2TltPpXJf3kXTxQhPvBXwlgry7tsAYnmdA 6m5uw0LZe1Dl6rinqQvm9WUFyM36BPVnaWW+yhSPflADc2KTwud8A4GZa0EGsHk+Fy0h dog3do1qjQkA6mIT75KJXOyo9h9icapec9WGumZgpCFhbKLOqDOUEvp9wlhduGVq+56D Izi9krQ9CMMsUpLpEFxHbIy0xl7xauICGqJcnjHxdJgeWNitzV6vidz3ulJ4D9aJOsWM RRPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=Dr4rQZbGbc/VL5lm5IbTJmHVcud2noviZG6/MiSOg98=; b=T0xFglpmpjPJbue1/pIC0druiqJuhfL42hl+6zPtHwMXY3GPiUk4odiVBasyfYKUxM d+ETmLmGdXGTOHHbQS0VnxcLKoPht6jk410gT78AOpe1lwUP57ZePed8DNs9GZMbnes3 KFsc6FM9Bh1SwoEFLBLFmv2sL1vmXb0ZRTbUsvlq0LnRi+Zz4GPRESTYG3XN4x7MmmQw WK+72Xhbv+DwNfrj15ZXZ18wh2l1ljcueKV35RO945kx+RcZbEIL1gA+dkqHnnUGVo9X VtjTkIEQQTX9RCU0WNBK0uvqFuryCq2vvvUC1lhf8BZVs9sAhhI/l66b1fp0lWyfc2yz ORow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=Fq4YgKLN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b5si5930208ybo.67.2021.02.04.07.44.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Feb 2021 07:44:54 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=Fq4YgKLN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: from localhost ([::1]:49854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7goP-00080V-NF for patch@linaro.org; Thu, 04 Feb 2021 10:44:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7gjO-00030V-0N for qemu-devel@nongnu.org; Thu, 04 Feb 2021 10:39:42 -0500 Received: from mail.zx2c4.com ([104.131.123.232]:36682) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7gjK-0002Oj-7a for qemu-devel@nongnu.org; Thu, 04 Feb 2021 10:39:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1612453173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Dr4rQZbGbc/VL5lm5IbTJmHVcud2noviZG6/MiSOg98=; b=Fq4YgKLN6iyBnScWaLcJn0c4/5IgFsgdSa2QvYFKmCX0d+iGqUGvHy1y0/5TavdIQS9BWY RwQkv2G09i0SnkbL1HiHc/iLyvZ6s4Kswh0POwHuMV7OzrWpVpoftFNetn1uSRHG2k9LMC SU/7e9BO4JypXW+WPu3oJpj4uoAnPCs= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 8ba96afa (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Thu, 4 Feb 2021 15:39:32 +0000 (UTC) From: "Jason A. Donenfeld" To: qemu-devel@nongnu.org Subject: [PATCH] linux-user: add TARGET_SO_{DOMAIN,PROTOCOL} Date: Thu, 4 Feb 2021 16:39:25 +0100 Message-Id: <20210204153925.2030606-1-Jason@zx2c4.com> MIME-Version: 1.0 Received-SPF: pass client-ip=104.131.123.232; envelope-from=Jason@zx2c4.com; helo=mail.zx2c4.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Jason A. Donenfeld" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These were defined for other platforms but mistakenly left out of mips and generic, so this commit adds them to the places missing. Then it makes them be translated in getsockopt. Signed-off-by: Jason A. Donenfeld --- linux-user/generic/sockbits.h | 3 +++ linux-user/mips/sockbits.h | 2 ++ linux-user/syscall.c | 6 ++++++ 3 files changed, 11 insertions(+) -- 2.30.0 Reviewed-by: Laurent Vivier diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h index e44733c601..b3b4a8e44c 100644 --- a/linux-user/generic/sockbits.h +++ b/linux-user/generic/sockbits.h @@ -55,4 +55,7 @@ #define TARGET_SO_ACCEPTCONN 30 #define TARGET_SO_PEERSEC 31 + +#define TARGET_SO_PROTOCOL 38 +#define TARGET_SO_DOMAIN 39 #endif diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h index 0f022cd598..562cad88e2 100644 --- a/linux-user/mips/sockbits.h +++ b/linux-user/mips/sockbits.h @@ -40,6 +40,8 @@ #define TARGET_SO_SNDTIMEO 0x1005 /* send timeout */ #define TARGET_SO_RCVTIMEO 0x1006 /* receive timeout */ #define TARGET_SO_ACCEPTCONN 0x1009 +#define TARGET_SO_PROTOCOL 0x1028 /* protocol type */ +#define TARGET_SO_DOMAIN 0x1029 /* domain/socket family */ /* linux-specific, might as well be the same as on i386 */ #define TARGET_SO_NO_CHECK 11 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 34760779c8..264b3265b1 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2832,6 +2832,12 @@ get_timeout: case TARGET_SO_ACCEPTCONN: optname = SO_ACCEPTCONN; goto int_case; + case TARGET_SO_PROTOCOL: + optname = SO_PROTOCOL; + goto int_case; + case TARGET_SO_DOMAIN: + optname = SO_DOMAIN; + goto int_case; default: goto int_case; }