From nobody Fri Apr 22 15:09:39 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 5A0851996591; Fri, 22 Apr 2022 15:09:39 +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 4KlHrM24xHz3vxF; Fri, 22 Apr 2022 15:09:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650640179; 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=yLzFs4D8jZvt1tPdNEKNkLTmhM8JaIkfHcdT9Mvcc8o=; b=s87QZ+I5SEEWy/PzL/we+snn2fx29sPg52zzPGsRuOomcf2O38DQbcPxoWBkOCkbEX71PD vldOLkyS3Pmjjbaxx2VsDcagExseLkVuWW6vvLZDZXDP8iqEW3z0g9lRH/254c/Olf5Xug YjTbncqmo4mi0yvkFWhaa+MhAAnZ0aDBPq8UadSl9tlSsJu2RREicl6APzkPf7DkPOWqRR pEWE9ANu6dlyPoqYLFHTr06tt0UUF1DKwTcwejpQ+0guPbNTV2mgYUkbq+UB7aOJlgaH6f fPWZtIKujHfGy4TqhFY3G89o3CbNTxhBvuNoZ0Tu9RvUobi+w4wHVMc2suHPpQ== 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 28D521F559; Fri, 22 Apr 2022 15:09:39 +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 23MF9dOa055787; Fri, 22 Apr 2022 15:09:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23MF9dJT055786; Fri, 22 Apr 2022 15:09:39 GMT (envelope-from git) Date: Fri, 22 Apr 2022 15:09:39 GMT Message-Id: <202204221509.23MF9dJT055786@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: 797b94504f4f - main - udp6: allow udp_tun_func_t() to indicate it did not eat the packet 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: 797b94504f4fd457aef694c236705c1bd850f2f7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650640179; 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=yLzFs4D8jZvt1tPdNEKNkLTmhM8JaIkfHcdT9Mvcc8o=; b=OU8wXXTmAoIjraKr3W7wl41pcfL86HlBqxeMr7mElhQCxSgnE4LqVE3YOrVGuWH14Bqiiv BKgkvdDd+ZFzXWfmiFUVVOayvAKavqFnSpFMFEPxJBl7xx8bEAz2eqDeiOFwPyQpsaR1ls hBL1vgOqnr+1J9MtuF2aVZLAWbpYalQ+9isPiZ+ZRxONuRJ5yzpKJGVD9f8u+BHD5g7s0j bUTn9JFx1MyWWpSHDZYd1BSaZsiet4lZWosE0E633X1BO6wuTo5P2ZPHSObjTSXW8HKHBk RpRB5LPj1/JSG40/FMly4JDFd06poONBNmIkWVkvblzGbUKRfS/ny7VZ+slLDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650640179; a=rsa-sha256; cv=none; b=TM1FlDdCZ0iP3v0fEWDB3UlpWldXZ4QTBcrTiuQHaxkINhvA4W6JIXbvBqRUeMM4aEvUbS uBK8ZfGFplqtLG9JYhagIHw3KmOG8UKNp0BVkxMeOuT1Nwo1F2HuLU9xdQlXH66kSNMTRF 3WrRwOVf1Bh9hcsEQyB0QMYzXEhLEL08bmlipEk6i0+Rg7xxBquugys5FW0GI69jmM3okM Ul/dzfKGdABFCSmkslmWcIAAgGmOjkEqH3V7LH1TXNPe5VJ+r/b2U01TLQeb2P0VpmT7cy 2+rmyCqylBEmWDtcIViOBqbZPNB0rrWKM5gLzSCCV4wO2ujAe8i/z2XbCVioRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=797b94504f4fd457aef694c236705c1bd850f2f7 commit 797b94504f4fd457aef694c236705c1bd850f2f7 Author: Kristof Provost AuthorDate: 2022-04-22 14:11:31 +0000 Commit: Kristof Provost CommitDate: 2022-04-22 14:55:23 +0000 udp6: allow udp_tun_func_t() to indicate it did not eat the packet Implement the same filter feature we implemented for UDP over IPv6 in 742e7210d. This was missed in that commit. Pointed out by: markj Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netinet6/udp6_usrreq.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 2f463da9b01b..20b78009854e 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -146,6 +146,7 @@ udp6_append(struct inpcb *inp, struct mbuf *n, int off, struct socket *so; struct mbuf *opts = NULL, *tmp_opts; struct udpcb *up; + bool filtered; INP_LOCK_ASSERT(inp); @@ -156,10 +157,11 @@ udp6_append(struct inpcb *inp, struct mbuf *n, int off, if (up->u_tun_func != NULL) { in_pcbref(inp); INP_RUNLOCK(inp); - (*up->u_tun_func)(n, off, inp, (struct sockaddr *)&fromsa[0], - up->u_tun_ctx); + filtered = (*up->u_tun_func)(n, off, inp, + (struct sockaddr *)&fromsa[0], up->u_tun_ctx); INP_RLOCK(inp); - return (in_pcbrele_rlocked(inp)); + if (filtered) + return (in_pcbrele_rlocked(inp)); } #if defined(IPSEC) || defined(IPSEC_SUPPORT) /* Check AH/ESP integrity. */