From nobody Wed Dec 14 05:49:41 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 4NX4FL0TbVz4kvG1; Wed, 14 Dec 2022 05:49:42 +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 4NX4FL048rz3PNr; Wed, 14 Dec 2022 05:49:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670996982; 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=wT/EWeJ75DiC/G30blJM9f1miqdwZh5J8ZV6GT11dos=; b=g5mTdWmzW4avQKb6clQxiUWDQU+GGtAS8ld3Ybbl71C+d0Vu3yPvkp6veU8b8doHuM0Sgq evadS3L8LL/B7ZO2cS84+CrWIi7FxWEoE0zTgdZydsy13LZ3oR/qEQaWYNgGW2dNqc55o4 GgtgbzXVFEvRiIm/LS2vB/BRxKXX9G5H16Fd79kb8THUEE1t86FH7Q2NKG8PXeBe6pUVrO H55vb6ZdIpNoSaaU1AaU3zthSTZ7MDIqf3iE/rvwRKlE95eZQf/Wo0vKCuovA0fl+PAFxx ZbON3QMWb3agvf0OYioggrVoMX/o3CHG5sLSDDinXnhWnPwmxqpOuLKXjXVTnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670996982; 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=wT/EWeJ75DiC/G30blJM9f1miqdwZh5J8ZV6GT11dos=; b=x9kOA+ZyciXavZPCAyvC4DFCZJjxkMHaVmvV5+6tFuYniN5qrCY/+AHtAivu9+3ciTFm30 RADAXUFqse9y54fZIWKLlQxZlr3RoJiIm/8IOUDLJlhkgrd/ZdhLsJx0hjEJ3zvYI1VGfP UIABd8BD1kowrkQrp/SLDW3SPm1QN403sktwY5gsICIDsvn3IfcxfAFVpK+Xj9YabuP/3d 8H/1RpFsAolDs6yfJzdc8PuJhg85ykm0Fphc3ynV75FuF6k02sDpSQgtMbP824YTvZT8Qs 7i1dFIEiLunT6lHKsdboJhOLYgRNBpVhPtH0feIZuYiNAW3xw4VpYTa84Z7K8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670996982; a=rsa-sha256; cv=none; b=JyCztu/K9xP8dnYGvq+/goaEjWS4aZgEFLwmOncPT+GlYytIWtprrTKEP2ULHI0SIrGeTd cxr6XoC5Rvtz4MOfRylQewxympaGRNWElF6Dbj4CrsZKGcA5lgTUh2tRaEYSnzA5ht1UJy 0cTLEkqb/o8MS9qzs2+NLjY8ZiCjNBqaadvKJK3y0C07MJUQKuMfwd+G6h8jIepTJuibnl jvErJjOMTME7Vmdlod6yxzPaFMj89lxVggLgFVXOba0l2+qBwOHCbVX35XMwYmmj3qmwNo 8F/BLOam+CRoEBtKONVn8PSDt6fZuS+Bfjo6dqIJBS/f4jWH8E0cJbQyBwSZeQ== 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 4NX4FK60GDzjY0; Wed, 14 Dec 2022 05:49:41 +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 2BE5nfMs034583; Wed, 14 Dec 2022 05:49:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BE5nfEe034582; Wed, 14 Dec 2022 05:49:41 GMT (envelope-from git) Date: Wed, 14 Dec 2022 05:49:41 GMT Message-Id: <202212140549.2BE5nfEe034582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 66de89d4c298 - main - if_ovpn: remove OVPN_SEND_PKT 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66de89d4c29827f0b33561afb0900208da0d3d05 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=66de89d4c29827f0b33561afb0900208da0d3d05 commit 66de89d4c29827f0b33561afb0900208da0d3d05 Author: Kristof Provost AuthorDate: 2022-11-26 12:52:40 +0000 Commit: Kristof Provost CommitDate: 2022-12-14 05:48:58 +0000 if_ovpn: remove OVPN_SEND_PKT OpenVPN userspace no longer uses the ioctl interface to send control packets. It instead uses the socket directly. The use of OVPN_SEND_PKT was never released, so we can remove this without worrying about compatibility. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D37602 --- sys/net/if_ovpn.c | 52 ---------------------------------------------------- sys/net/if_ovpn.h | 2 +- 2 files changed, 1 insertion(+), 53 deletions(-) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 0f326512b236..256d7d56bada 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -932,55 +932,6 @@ ovpn_del_key(struct ifnet *ifp, const nvlist_t *nvl) return (0); } -static int -ovpn_send_pkt(struct ifnet *ifp, const nvlist_t *nvl) -{ - struct epoch_tracker et; - struct ovpn_softc *sc = ifp->if_softc; - struct mbuf *m; - const uint8_t *pkt; - size_t pktlen; - uint32_t peerid; - int ret; - - if (nvl == NULL) - return (EINVAL); - - if (! nvlist_exists_binary(nvl, "packet")) - return (EINVAL); - pkt = nvlist_get_binary(nvl, "packet", &pktlen); - - if (! nvlist_exists_number(nvl, "peerid")) - return (EINVAL); - - peerid = nvlist_get_number(nvl, "peerid"); - - /* - * Check that userspace isn't giving us a data packet. That might lead - * to IV re-use, which would be bad. - */ - if ((pkt[0] >> OVPN_OP_SHIFT) == OVPN_OP_DATA_V2) - return (EINVAL); - - m = m_get2(pktlen, M_WAITOK, MT_DATA, M_PKTHDR); - if (m == NULL) - return (ENOMEM); - - m->m_len = m->m_pkthdr.len = pktlen; - m_copyback(m, 0, m->m_len, pkt); - - /* Now prepend IP/UDP headers and transmit the mbuf. */ - NET_EPOCH_ENTER(et); - ret = ovpn_encap(sc, peerid, m); - NET_EPOCH_EXIT(et); - if (ret == 0) - OVPN_COUNTER_ADD(sc, sent_ctrl_pkts, 1); - else - OVPN_COUNTER_ADD(sc, lost_ctrl_pkts_out, 1); - - return (ret); -} - static void ovpn_send_ping(void *arg) { @@ -1170,9 +1121,6 @@ ovpn_ioctl_set(struct ifnet *ifp, struct ifdrv *ifd) case OVPN_DEL_KEY: ret = ovpn_del_key(ifp, nvl); break; - case OVPN_SEND_PKT: - ret = ovpn_send_pkt(ifp, nvl); - break; case OVPN_SET_PEER: ret = ovpn_set_peer(ifp, nvl); break; diff --git a/sys/net/if_ovpn.h b/sys/net/if_ovpn.h index 3db36f5b0539..5ea2ae6dd2ec 100644 --- a/sys/net/if_ovpn.h +++ b/sys/net/if_ovpn.h @@ -62,7 +62,7 @@ enum ovpn_key_cipher { #define OVPN_DEL_KEY _IO ('D', 6) #define OVPN_SET_PEER _IO ('D', 7) #define OVPN_START_VPN _IO ('D', 8) -#define OVPN_SEND_PKT _IO ('D', 9) +/* OVPN_SEND_PKT _IO ('D', 9) */ #define OVPN_POLL_PKT _IO ('D', 10) #define OVPN_GET_PKT _IO ('D', 11) #define OVPN_SET_IFMODE _IO ('D', 12)