From nobody Fri Jun 17 19:41:08 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6276385DA00; Fri, 17 Jun 2022 19:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LPqCn33qnz3hqN; Fri, 17 Jun 2022 19:41:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uRrzJTFZajUmXd0tSHJEsIwvAJZ8R0HkNmnG+Uel1Ag=; b=e/5WtFkkULj+RNGhgjlBoiuFcFcWVMwU8daKtsMao5yeDr+3wLakPFj0lvT8ytRYp8+5Ck aZa3QEK/R+iQ8mzi0Nx9W7o20lX3eLiIu/wEMfer4lFE1peEg4gylLk58qWXntUvbVO1up 17gmCgAQAvrrgXQ81t0xfYQhW4EuXCnr6Zr3JA7+Ch3bZMFBgJIttvZNJkEvKfCPOSPrU4 qkpojtNkDE6spiTCRhY/VavBxhhTVkGCoSB4S3xK2CepAgSZlfaz4HrTgrQEakBBlbMJOY fEOlUWBK1TYFu0l1joUMWX5/6YkgE8kBnMADBs2DNI9itWqlqCUszsUiyO88yw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3E9A25DA9; Fri, 17 Jun 2022 19:41:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25HJf8KN030083; Fri, 17 Jun 2022 19:41:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJf8J1030082; Fri, 17 Jun 2022 19:41:08 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:41:08 GMT Message-Id: <202206171941.25HJf8J1030082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: dfbeda6cf4c8 - stable/13 - linux(4): Fix SO_LINGER l_onoff value List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dfbeda6cf4c8bb9ad64ec79a0dea8b80e4b94b57 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uRrzJTFZajUmXd0tSHJEsIwvAJZ8R0HkNmnG+Uel1Ag=; b=gn+CKFNm9Jlyzko2wFs/55tmhdcs7wrQm6niot/0Li+rbxZR6YzQRyelRJ/utGd6V0Fext D1KyctMzJzfumqPmkNbf0XvjhjrG2io107ZyAFDzh6kGHQcF5gTir4Am6W5Cql3JG7QEkf C1TgU9pNXyIrwbyEg4UOPgxw4xsiAFUHEbXA2JfY+6HgTchhB9QjRX7gcughwqfunZ/gwy QqLN7M+CtjsfdyDQ48OKx/8nVBiB2KX3stWkJAsOrUvwXp74Lrj43Llui9NaooM1pgnOin QKDXLy74a69s24IvGQLHHxwEWqGm0QUl4k7GRuceE8TJ0rXZ+TkK2/mcLOL+fA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494869; a=rsa-sha256; cv=none; b=mim4ObwrVPJFwYifQ5ZIftv1gzQwP28wjF5cX4elzyjVw3MVk//6LtCWkriQNv14IgP4uY S+EQyDxAPKVjr2nlxLjciMkf4dK35b57m2yZFKLhoHfigOWrNKF/BgxJa09RuDMpUU/Uy1 MEgqmatke1niLZPrMpsh6OxVoXIbyRBuD1SATBlF+/A23wxXbdol1p745S4eZ0OTK5Elai sFFEFRW+mxWtU2Puqk1GpWtWvtsgYdM97iTTPo9pWHXNeqlaYVsB3c6D2nvZ1i0ooBWWJ5 PlvxRKAkCcnE17O0HAQc9N51yDfjzhIWgx9mxNX+Kz0e6ltEBsowtGP0I9Mj9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=dfbeda6cf4c8bb9ad64ec79a0dea8b80e4b94b57 commit dfbeda6cf4c8bb9ad64ec79a0dea8b80e4b94b57 Author: Dmitry Chagin AuthorDate: 2022-05-28 20:31:06 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:35:32 +0000 linux(4): Fix SO_LINGER l_onoff value On Linux l_onoff should be 1 when linger is used. MFC after: 2 weeks (cherry picked from commit e8d9d8082be339d046826e543e8e835c61e2d4b0) --- sys/compat/linux/linux_socket.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 0c003cd5729f..1214c2e1fa24 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1992,6 +1992,22 @@ linux_getsockopt_so_peersec(struct thread *td, len, args)); } +static int +linux_getsockopt_so_linger(struct thread *td, + struct linux_getsockopt_args *args) +{ + struct linger ling; + socklen_t len; + int error; + + len = sizeof(ling); + error = kern_getsockopt(td, args->s, SOL_SOCKET, + SO_LINGER, &ling, UIO_SYSSPACE, &len); + if (error != 0) + return (error); + ling.l_onoff = ((ling.l_onoff & SO_LINGER) != 0); + return (linux_sockopt_copyout(td, &ling, len, args)); +} int linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) @@ -2075,6 +2091,9 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) return (linux_sockopt_copyout(td, &newval, len, args)); /* NOTREACHED */ + case SO_LINGER: + return (linux_getsockopt_so_linger(td, args)); + /* NOTREACHED */ default: break; }