From nobody Fri Sep 27 22:17:15 2024 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 4XFlFS1hQgz5XKLq; Fri, 27 Sep 2024 22:17:16 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFlFR5bz2z4kqw; Fri, 27 Sep 2024 22:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727475435; 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=3v14jfXR3yo7vxEq7PLJ1WjDKLE0S9w/FfPnTxnzd7Y=; b=WmG6iSlf1g+/VZQBG9sFwtumUaaVbJmo3gG0z64jT++bQpwvsKNaS1JKW5bYhD7gOlivme syHfjM0HHHbLRng6OPOVM55vpZno9gN/AQ9+kzfxyStVTjpgHpt2o55oj8iV6w32bMPDwD 5IvIoAqYqIrf7NcWHFL0s2hXa9kfp3qf4/gjzI+SrP12T7ZVS5w1vVOgF2PTtZ9/C3kCFh KjaT+X1ygRFmAkwviIVOa2Hv4b2e2pjb7TiiAyvxd7HDIpQ8EiwxGci8O4jVZCAtpfV1cs PdS/+fvgpIA+88ATEAGKhcE/Vrqi+jSaDojvx75cKOoBXuet6phzJvhdNhyDaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727475435; 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=3v14jfXR3yo7vxEq7PLJ1WjDKLE0S9w/FfPnTxnzd7Y=; b=L45fh1d7RAB4aHk3hTKig6al0nyqQpPLFv2mP1cm2C6jjoybd79aXYX6ZcuP34v6z4lSbG 47IEa5DJ4yGoRwR46NB0hcqNWmGiosRB4DppMUSyPwOc0jGBCfC25MhNxBxZTl5XBGgYQ7 DQuq0O/k8QScQqfZt07kWIsBLs7gmg9pmSKAYO0zO65upqo1AjeZmk8whYTms7jPbkR/m7 C7OWVhBFehGPaPevvgoNzwo5njpY0eq3hpTA/WEsFH0567aPoMSUpTcEpvtcgRu1Ez9pIm APPkfYZj52W+P+Tga6nbEU1bmFO/IIT2VqJdvgvdpjbVsjjAO50AoZOWS4nzhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727475435; a=rsa-sha256; cv=none; b=LwYXWe0V0xrDSkQMIpCuh4lBPHo02m0nho4pn/vufSZ8m2lrsctR0uOXrgTNa23pl+RBbh tC0T9KZADox+NV9ifNAkHQdD/YvaqQiKHR9/gZRajZLFMmK6ILr8VtJvfm3KYVULeSqyJ8 Ob4XHckw8NHFv71GsIzKKpBG9Cp4H38/fT1UJ5qSces6zHRD67npcfYp0gv3SGvnVts2We g4Emg8B5SGmLsXxTmiTOcyyYdvmqIo5zYfCUaJQL+kWSGifHfuWY48VYhwuwc7b+ZcPfFv AmyqvjY4OUMgyyG1CEC5T/fy1LxVz4lYWLno+PhWpSfZ3XnEh28xZNpYK56p2Q== 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 4XFlFR4J6dzy48; Fri, 27 Sep 2024 22:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48RMHFxv039323; Fri, 27 Sep 2024 22:17:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48RMHFag039320; Fri, 27 Sep 2024 22:17:15 GMT (envelope-from git) Date: Fri, 27 Sep 2024 22:17:15 GMT Message-Id: <202409272217.48RMHFag039320@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: f8e994296328 - main - pf: remove ip(6) header argument from pf_reassemble(6)() 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: f8e99429632822cf22a7a0999c00a4a9db1f3702 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f8e99429632822cf22a7a0999c00a4a9db1f3702 commit f8e99429632822cf22a7a0999c00a4a9db1f3702 Author: Kristof Provost AuthorDate: 2024-09-11 15:21:09 +0000 Commit: Kristof Provost CommitDate: 2024-09-27 20:13:23 +0000 pf: remove ip(6) header argument from pf_reassemble(6)() Instead of passing the ip header and mbuf to pf_reassemble(), lookup the header address in the mbuf. ok henning@ Reviewed by: zlei Obtained from: OpenBSD, bluhm , 074ee1f915 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46652 --- sys/netpfil/pf/pf_norm.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index c4cc482c62f0..d1a1e84db9dc 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -151,10 +151,10 @@ static struct pf_fragment *pf_fillup_fragment(struct pf_fragment_cmp *, struct pf_frent *, u_short *); static struct mbuf *pf_join_fragment(struct pf_fragment *); #ifdef INET -static int pf_reassemble(struct mbuf **, struct ip *, int, u_short *); +static int pf_reassemble(struct mbuf **, int, u_short *); #endif /* INET */ #ifdef INET6 -static int pf_reassemble6(struct mbuf **, struct ip6_hdr *, +static int pf_reassemble6(struct mbuf **, struct ip6_frag *, uint16_t, uint16_t, u_short *); #endif /* INET6 */ @@ -741,9 +741,10 @@ pf_join_fragment(struct pf_fragment *frag) #ifdef INET static int -pf_reassemble(struct mbuf **m0, struct ip *ip, int dir, u_short *reason) +pf_reassemble(struct mbuf **m0, int dir, u_short *reason) { struct mbuf *m = *m0; + struct ip *ip = mtod(m, struct ip *); struct pf_frent *frent; struct pf_fragment *frag; struct pf_fragment_cmp key; @@ -814,10 +815,11 @@ pf_reassemble(struct mbuf **m0, struct ip *ip, int dir, u_short *reason) #ifdef INET6 static int -pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, struct ip6_frag *fraghdr, +pf_reassemble6(struct mbuf **m0, struct ip6_frag *fraghdr, uint16_t hdrlen, uint16_t extoff, u_short *reason) { struct mbuf *m = *m0; + struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); struct pf_frent *frent; struct pf_fragment *frag; struct pf_fragment_cmp key; @@ -1170,7 +1172,7 @@ pf_normalize_ip(struct mbuf **m0, struct pfi_kkif *kif, u_short *reason, * Might return a completely reassembled mbuf, or NULL */ PF_FRAG_LOCK(); DPFPRINTF(("reass frag %d @ %d-%d\n", h->ip_id, fragoff, max)); - verdict = pf_reassemble(m0, h, pd->dir, reason); + verdict = pf_reassemble(m0, pd->dir, reason); PF_FRAG_UNLOCK(); if (verdict != PF_PASS) @@ -1360,7 +1362,7 @@ again: off += sizeof(frag); /* Returns PF_DROP or *m0 is NULL or completely reassembled mbuf. */ - if (pf_reassemble6(m0, h, &frag, off, extoff, reason) != PF_PASS) + if (pf_reassemble6(m0, &frag, off, extoff, reason) != PF_PASS) return (PF_DROP); m = *m0; if (m == NULL)