From nobody Sun Nov 05 14:31:47 2023 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 4SNcPJ1wfZz50KbH; Sun, 5 Nov 2023 14:31:48 +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 4SNcPJ1CWHz4Rgs; Sun, 5 Nov 2023 14:31:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699194708; 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=S1EW02lM3cjNUJpVsAwhjLkb25N6hy977HbVfXoKncE=; b=l6LjQuxA9efJQvSrcRxZ29/tyVVGTyMLNJRts5zD8xa9rPiAQO/UzSxUL/FXDhfUmljQXx o0lKZDTWIOwnaFjB2cAo00K52ZyvobBPe7+g2PwNz1kJpgtYYR7VRrIhtYqdiQcYltjXWk nMqNUtCksiFZ40egkHGcMQ+cww4DgsddCzDLuNO+5W6+1kv+F9mnO9WrHCeRIWRmzauYhl srI+mMeM4UVyj4iJ5R8enCvgOXpQa8QBRqj19w+bokgEpAJcr8SvHT404RikgFr/IGQ3fN hETXLcue3w5MT9coMDfMzyRj3dB5tzXIRbYT9WFIQshYFkwoGMnVFnN53BOQtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699194708; 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=S1EW02lM3cjNUJpVsAwhjLkb25N6hy977HbVfXoKncE=; b=xW0We1Ekq8ZeimFkr1EpLajfeB8uJovxbAuZ9YBjfBagnyUUuvNOkk6HYBVqTydIcHfzlg vAaVhR6BnBZ8wBbI76Recs1AP0RNSwIKEG1wB8A9b+d8IPZtBbyHfueYLfOzdAPj9ZLN4f QzO4iqG/67N9T5gQA70BiGGMxpom/I64kDC0lbcvLugXyHvnu1Wy+dyOz2JVqT1ten/V0j qK0X2p3ukVkHpU85iDzvSU3RK75Y6I3/8+xnk8+nfENMyAerVoszKqFbaJoDZa6sLYnSrb WE1kdCbJmfSnXLwv8gpw4EWwCdlzQnleLr9putBJS57PoQ6T9MvJswQPqCQLoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699194708; a=rsa-sha256; cv=none; b=au8TyG4YZyf58pCHlq+b32kzTyOloM8+JnjTqfbwzJk8dT8JIwaoyiaUG+mEUXJXs0PdeK /drDxn9CQncJfRUtaOIEFqX2aK7Xt39qWhUXUvo/Ly0QNkR2dc0Tr3C7Qrv5ucsGipsmQH ntt2bVJijNiNHaO780gmgPdmNid/8mkwT8yjIbP+fFpMQdwxCEXvYs0Ty/rihLKA9MkieJ 7F/N3w8f/R1oDYFHtL+8QRPSC4wcvuhCIcMUyhhgsYahqgDof8UZ9ZMtsb5KOA9HKDBa7t 80Y3dKawxw99e0ymmhRe2Ufu+Lk0wbQmwHsarjJ7OQfODLgBgQ/y40L9PAABGw== 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 4SNcPJ0HGqzDQc; Sun, 5 Nov 2023 14:31:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3A5EVl4Q035324; Sun, 5 Nov 2023 14:31:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A5EVlMp035321; Sun, 5 Nov 2023 14:31:47 GMT (envelope-from git) Date: Sun, 5 Nov 2023 14:31:47 GMT Message-Id: <202311051431.3A5EVlMp035321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 03c3a70abe5e - main - udplite: make socketoption available on IPv6 sockets 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03c3a70abe5e9fa259b954de78ae69229fa9c99f Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=03c3a70abe5e9fa259b954de78ae69229fa9c99f commit 03c3a70abe5e9fa259b954de78ae69229fa9c99f Author: Michael Tuexen AuthorDate: 2023-11-05 14:28:54 +0000 Commit: Michael Tuexen CommitDate: 2023-11-05 14:28:54 +0000 udplite: make socketoption available on IPv6 sockets This patch allows the IPPROTO_UDPLITE-level socket options UDPLITE_SEND_CSCOV and UDPLITE_RECV_CSCOV to be used on AF_INET6 sockets in addition to AF_INET sockets. Reviewed by: ae, rscheff MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42430 --- sys/netinet/udp_usrreq.c | 8 ++++++++ sys/netinet6/udp6_usrreq.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index a96ec22c5992..069cd8623464 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -897,6 +897,10 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt) #if defined(IPSEC) || defined(IPSEC_SUPPORT) #ifdef INET case UDP_ENCAP: + if (!INP_CHECK_SOCKAF(so, AF_INET)) { + INP_WUNLOCK(inp); + return (EINVAL); + } if (!IPSEC_ENABLED(ipv4)) { INP_WUNLOCK(inp); return (ENOPROTOOPT); @@ -944,6 +948,10 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt) #if defined(IPSEC) || defined(IPSEC_SUPPORT) #ifdef INET case UDP_ENCAP: + if (!INP_CHECK_SOCKAF(so, AF_INET)) { + INP_WUNLOCK(inp); + return (EINVAL); + } if (!IPSEC_ENABLED(ipv4)) { INP_WUNLOCK(inp); return (ENOPROTOOPT); diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 4e69608b71de..068b9e7095a9 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -1244,7 +1244,7 @@ udp6_disconnect(struct socket *so) #define UDP6_PROTOSW \ .pr_type = SOCK_DGRAM, \ .pr_flags = PR_ATOMIC|PR_ADDR|PR_CAPATTACH, \ - .pr_ctloutput = ip6_ctloutput, \ + .pr_ctloutput = udp_ctloutput, \ .pr_abort = udp6_abort, \ .pr_attach = udp6_attach, \ .pr_bind = udp6_bind, \