From nobody Wed Feb 09 19:03:53 2022 X-Original-To: dev-commits-src-main@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 A475D19ABD83; Wed, 9 Feb 2022 19:03:54 +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 4Jv8Rt3XwPz4r6p; Wed, 9 Feb 2022 19:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644433434; 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=/MADJ1n/6xJmwIXyd0v4hg7wcWKQzzeMX3XL/5x9xug=; b=kALrdtLeU0xEyUkO7cWi+XW8+6jgcUNFmT12cIWCOI7X0pG8PpMwLHSU8uSeFr3P5VZgp4 LdhxWicvpn8AmQinbihpffKJhAJ77ZlROjcP6u7COj3JLNIT6aeVczHbRUOWu8/SjEmgXJ B6FWmHYhgqgbEQ+D0eOhtEUMXa03lPzjFizwYbr4V6IRVjuvb9qA9mWMoHZfzuWhSKR9CU bx1ownOab4AXZo9b6RzCDDruOv5hkTDTT/k9i1bnWLShoKbJgha7rDLB/bHNIdfW3UBr0i V4z5qJhSZG4ipvazMan4D4G4Wz2vUGV7zLfGkZruEZYTXqXs8sOEJJiQ4gQ2PQ== 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 17FA5125FD; Wed, 9 Feb 2022 19:03:54 +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 219J3rrA054885; Wed, 9 Feb 2022 19:03:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 219J3rUZ054884; Wed, 9 Feb 2022 19:03:53 GMT (envelope-from git) Date: Wed, 9 Feb 2022 19:03:53 GMT Message-Id: <202202091903.219J3rUZ054884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aleksandr Fedorov Subject: git: b27e6e91d0ad - main - ng pppoe(4): Add the required NET_EPOCH section to the hook disconnection function. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: afedorov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b27e6e91d0ad1f87b296f7583d4f5d938d7a997c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644433434; 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=/MADJ1n/6xJmwIXyd0v4hg7wcWKQzzeMX3XL/5x9xug=; b=vDTCn2zpKQHkL3433mobL0E7mBXTRIOe1BnW80TLyIpnFP+jZhuicDbQS50fRAaz4QAp1Z yiueRxsuY5ZXMZK0+tF6n7DYS7ckOfXZFCtMdZ3/KYF0/+l+w01c9HMhZljddsFUTXUeQ3 b4PtZxVrRn6YKqLPsQE9zuwfv24Xmn0+vOL6SosOPuDw4zNSRdDCIeTsYcuoGyO957t27Z 20L6BD2s9rBlmfSyqgC0rR4Lj1XKiwH//RWRsTGD++95v+xB3Cx7x9IoX3UZtVdPjnq1rs +hpESMljUR2pqes95qs/Y+VsJTHpZNh9mOfb1yDbfiYE9z9WZIBmiUz9F/5yrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644433434; a=rsa-sha256; cv=none; b=WuYsFlax6KduG9mkVtsSlIvx/0d6klYmQ3VxcbTWkHHlhWsfuWzVi199CwMu5P2OKaCcU9 5IjUZQG3a8amXo0vIFNq78g316B5eeqcJ0eE1CexgTf7LHt9V/fMsvK0yzf2jlwke6axhc c8Fd6EMFIBkQTv0tZue40iMwpnJ+m3EOgmIi80VXHBpVb9lk2hpzQv0MDCyXlCkkHYw5+N cRiGEEYlfcM6PEEkf9Q6Z/xEFfRx8THKv7r/mrnUwsCszxXUHj2RmHZip/3L5YVrZURRS9 pe/qRiTel3tq/vrBPVic889YXlyBWVHzKG2/RKaDADVuZR8Y7CpPNSueH+X5jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by afedorov: URL: https://cgit.FreeBSD.org/src/commit/?id=b27e6e91d0ad1f87b296f7583d4f5d938d7a997c commit b27e6e91d0ad1f87b296f7583d4f5d938d7a997c Author: Aleksandr Fedorov AuthorDate: 2022-02-09 19:00:50 +0000 Commit: Aleksandr Fedorov CommitDate: 2022-02-09 19:00:50 +0000 ng pppoe(4): Add the required NET_EPOCH section to the hook disconnection function. Disconnecting hooks are called outside of NET_EPOCH, but ng_pppoe_disconnect() calls NG_SEND_DATA_ONLY() which should be called in NET_EPOCH. PR: 257067 Reported by: niels=freebsd@bakker.net Reviewed by: vmaffione (mentor), glebius, donner Approved by: vmaffione (mentor), glebius, donner Sponsored by: vstack.com Differential Revision: https://reviews.freebsd.org/D34185 --- sys/netgraph/ng_pppoe.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netgraph/ng_pppoe.c b/sys/netgraph/ng_pppoe.c index a18d6a0498a7..8bc44e160044 100644 --- a/sys/netgraph/ng_pppoe.c +++ b/sys/netgraph/ng_pppoe.c @@ -2031,6 +2031,7 @@ ng_pppoe_disconnect(hook_p hook) log(LOG_NOTICE, "ng_pppoe[%x]: session out of " "mbufs\n", node->nd_ID); else { + struct epoch_tracker et; struct pppoe_full_hdr *wh; struct pppoe_tag *tag; int msglen = strlen(SIGNOFF); @@ -2061,8 +2062,11 @@ ng_pppoe_disconnect(hook_p hook) m->m_pkthdr.len = m->m_len = sizeof(*wh) + sizeof(*tag) + msglen; wh->ph.length = htons(sizeof(*tag) + msglen); + + NET_EPOCH_ENTER(et); NG_SEND_DATA_ONLY(error, privp->ethernet_hook, m); + NET_EPOCH_EXIT(et); } } if (sp->state == PPPOE_LISTENING)