From nobody Wed Jan 24 18:09:09 2024 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 4TKsR96MBQz58SwX; Wed, 24 Jan 2024 18:09:09 +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 4TKsR95hXDz57K9; Wed, 24 Jan 2024 18:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706119749; 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=ENMwg8zWsXo68/8Sdc6kfWyRv0DC37PW2LJJMRU3S+g=; b=IVfl00t9/gJByZ0K3ZbKrcz0KkixzQOGN/XKJog8M3KQy/c9dAId1AzQ03He812hWw6+XH SV24MBSoReWQ7U1gyib3kFSbApAD9XULxJDE54gh0N9VAVefspLBY2Br2weQ9k5IpnzNxU 3J5EueIbAM5Yev4Gwb5puRW2de1cJWLvagebS4JMxFhMW4eF0NZlkMXzHeJhWLRq2W9L19 YB2Y+cUzB6BEYZq3DX+9rSOidyO/LUgnCc5xXjRTvfDzsEPckytO7dv8LiCHBr+oJfMiXY HFWqE6q7Gpwodnfrv8s5cKK9PNtE/SLcMtQCWewTFHzgxLZVBIpOt51e8Q/xvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706119749; 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=ENMwg8zWsXo68/8Sdc6kfWyRv0DC37PW2LJJMRU3S+g=; b=nvEl12umUEFkFLfTugAkPsNa9vQ8XUhw2ZlkoPHy/lpMtovcY/EIfpgm1LHgUaDZj/m7sp wj4T5aoOYCX+4FFO/VLf9pvPgwU+krS4DOoeaiHL+WxpdB9eEyzn5eA4zC9iVDwnPObKWa L+0vy67jpPhTBdb6pTm9oqVuztGX2AtOr/3tVu0io/fyjvcYpDridgYN8974VJj7Ow7+Gb tEQj5f+hWs/f+fuMTUhE80IRMoaJMclxoSUjMvdKHxphOYV0hpA2HigOKXV6nmm0wOcYL5 AWo39T1aTs8YvAX1ZCRhO8I9cIcd8hRTDqyRK6CtiAtTfLCTKKso0p6O/tQ4EA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706119749; a=rsa-sha256; cv=none; b=GcQw3l/FewY6hluR+57TGGdCe/JpJOIA0P/SvYASARIIb24WWTRCGdocpVDROIaerDkcRT 84TlKkCsg8qqHSgOAqkUZVjG8jNEl6agVqnGloYPpKsjkpLoUFN0bEAAJgyr1LWYLbq5KO ZeV7PsGoE8OmF8yExhF6oX8LGxRxB+vR8vx612X6VcCLW1brPoSTN/azVWAlKFusvbHZKI riOAY8CVhi0NcHJQLiY3T5mQGyXHCBmWpJTfmnkcO7P+C0KupQ/f8rpJ64+PknU3jkuk/A 0dJwF/hbsARX6l8ewofGfm2EM5lx9TErO0N/TJ+6LN4i2yFbHKTYdejAwoIHEQ== 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 4TKsR94fq9zPj5; Wed, 24 Jan 2024 18:09:09 +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 40OI99hu038214; Wed, 24 Jan 2024 18:09:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40OI9908038211; Wed, 24 Jan 2024 18:09:09 GMT (envelope-from git) Date: Wed, 24 Jan 2024 18:09:09 GMT Message-Id: <202401241809.40OI9908038211@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: f1c0030bb05c - main - pf: only check MTU for IPv6 packets when forwarding 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: f1c0030bb05cfa01bdd500e50befbb425fecc4c4 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f1c0030bb05cfa01bdd500e50befbb425fecc4c4 commit f1c0030bb05cfa01bdd500e50befbb425fecc4c4 Author: Kristof Provost AuthorDate: 2024-01-24 16:34:01 +0000 Commit: Kristof Provost CommitDate: 2024-01-24 18:08:29 +0000 pf: only check MTU for IPv6 packets when forwarding When the packets are generated locally (i.e. PFIL_FWD is not set) we might generate overly large packets and rely on the NIC to fragment it for us. In that case we'd reject a valid packet. Reported by: Herbert J. Skuhra Tested by: Herbert J. Skuhra Fixes: 54c62e3e5d8cd90c5571a1d4c8c5f062d580480e Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 38a5a45d7991..2dc6d02d330a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8515,7 +8515,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * confused and fail to send the icmp6 packet too big error. Just send * it here, before we do any NAT. */ - if (dir == PF_OUT && IN6_LINKMTU(ifp) < pf_max_frag_size(m)) { + if (dir == PF_OUT && pflags & PFIL_FWD && IN6_LINKMTU(ifp) < pf_max_frag_size(m)) { PF_RULES_RUNLOCK(); *m0 = NULL; icmp6_error(m, ICMP6_PACKET_TOO_BIG, 0, IN6_LINKMTU(ifp));