From nobody Mon Dec 16 22:34:14 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 4YBvr7289qz5gc76; Mon, 16 Dec 2024 22:34:15 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBvr65DFQz47KC; Mon, 16 Dec 2024 22:34:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734388454; 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=EB78ElJ4aREnX+oty7NvSVoNHXeVp8LXBUF2HVxsfqI=; b=GLFo4hsS90Q/l470Dbb/oaXcCZrIU4uRuLE2xpK4AYB7dpmL3MDSAKlnQKAQDaD7TQwkZ4 LJQLceLtmfGofDlIqoRK2nxqOAIj4951ijSvz9LahkSeA374rSvRydBSEqr+a2v1gDQfJY PQ0hQcqzi8nm3zcHiiwCo+LudE4qL6pef0EsOPUBefBsfMKv0MLRYAqxEwYlnNWPwmh66m igjDftM/KLqvKPKKJ6f5fAhix2hqEQqApJ5Nw3kKq7MzE9XMcB0Yp47lSBvUxS4L7DwhZn cvRJEbFOzPN3lBGVT1aS9pE9nsF2VmGtkGvH7Me5qJNZcNuulgJE5VbqkVkV7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734388454; 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=EB78ElJ4aREnX+oty7NvSVoNHXeVp8LXBUF2HVxsfqI=; b=NsnFtWk6z1XKpzDJTNpJ/Q3bBteBuVLe7HxuP4O2GmOyWEcTu4vbEaPvTB/Fett3RDx80Y og41we2BRymK+pby4PC1UAcHINwwO59G6Dx7j/s/+5kOfCF6iheAmq2I5ZuqxbgzdJuABL dkZrs0xHqN883eMHi1PITx+mUQA+9QPcq+C+kWQFlKq/InT81X8YDs1a0XknTD9m7Lt8DG NT/ewe4WlVzbM+Aa1FDnkpbxkbl1dqdW9kj3hMncH6cHXqOSr6q4TdGx3xkx1yO9imqim+ O2w43IId9AU34h7zLdswaGH+BySmIB5WKHj1MGkDlSONT5xaSO2uhPKMymGh5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734388454; a=rsa-sha256; cv=none; b=GBNSTP2P4xJ2XAz988cSGslFxGj+3NzgD+nBwtl5eDa0k+ROWFMz94a9vhDoHb9Vxp6Z9M cshKxYl/hywYOz5aKHD0m0NxWb9wBkKsUkem1uqZL/GOZFpArICsz/EFJZR3XnY7uuA4l+ d2sOoQN0dR66Rvgzw4m7HOABABskYbr8f6MwSLR03k1RSrLs3qEFIR6YaPuOQEEHzYAhgW Hi/wgxuSoEubwofeUhe2JFK6R3+KTqHoZ1GaDnS1Tr5yI3wGkFlwJ1zvnCrBTSJA0vjgHG t19vKS9nuTIHFe5DjYXEOVmv5lYc71xpdlNUhkPUmKvFLi1+4cArgBkRwtVF1w== 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 4YBvr64rQBz1BfZ; Mon, 16 Dec 2024 22:34:14 +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 4BGMYEZt031713; Mon, 16 Dec 2024 22:34:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGMYEak031710; Mon, 16 Dec 2024 22:34:14 GMT (envelope-from git) Date: Mon, 16 Dec 2024 22:34:14 GMT Message-Id: <202412162234.4BGMYEak031710@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: 85570785b9ce - main - pf: remove unused variable from pf_pdesc 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 85570785b9ced0adbc5761502defc88065fbb0cc Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=85570785b9ced0adbc5761502defc88065fbb0cc commit 85570785b9ced0adbc5761502defc88065fbb0cc Author: Kristof Provost AuthorDate: 2024-12-16 19:20:39 +0000 Commit: Kristof Provost CommitDate: 2024-12-16 22:33:56 +0000 pf: remove unused variable from pf_pdesc We only every assigned proto_sum, never used it. Remove it entirely. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 1 - sys/netpfil/pf/pf.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 30229cca2e74..100775347143 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1615,7 +1615,6 @@ struct pf_pdesc { u_int32_t badopts; /* v4 options or v6 routing headers */ u_int16_t *ip_sum; - u_int16_t *proto_sum; u_int16_t flags; /* Let SCRUB trigger behavior in * state code. Easier than tags */ #define PFDESC_TCP_NORM 0x0001 /* TCP shall be statefully scrubbed */ diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index a0c9a92c6b84..d0ddff9f38a2 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -3697,8 +3697,6 @@ pf_return(struct pf_krule *r, struct pf_krule *nr, struct pf_pdesc *pd, *pd->sport = sk->port[pd->sidx]; if (pd->dport) *pd->dport = sk->port[pd->didx]; - if (pd->proto_sum) - *pd->proto_sum = bproto_sum; if (pd->ip_sum) *pd->ip_sum = bip_sum; m_copyback(pd->m, pd->off, pd->hdrlen, pd->hdr.any); @@ -5010,7 +5008,6 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, switch (pd->proto) { case IPPROTO_TCP: bproto_sum = th->th_sum; - pd->proto_sum = &th->th_sum; if (PF_ANEQ(saddr, &nk->addr[pd->sidx], pd->af) || nk->port[pd->sidx] != sport) { @@ -5033,7 +5030,6 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, break; case IPPROTO_UDP: bproto_sum = pd->hdr.udp.uh_sum; - pd->proto_sum = &pd->hdr.udp.uh_sum; if (PF_ANEQ(saddr, &nk->addr[pd->sidx], pd->af) || nk->port[pd->sidx] != sport) { @@ -5584,8 +5580,6 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, *pd->sport = skt->port[pd->sidx]; if (pd->dport) *pd->dport = skt->port[pd->didx]; - if (pd->proto_sum) - *pd->proto_sum = bproto_sum; if (pd->ip_sum) *pd->ip_sum = bip_sum; m_copyback(pd->m, pd->off, pd->hdrlen, pd->hdr.any); @@ -8659,7 +8653,6 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, pd->src = (struct pf_addr *)&h->ip_src; pd->dst = (struct pf_addr *)&h->ip_dst; pd->ip_sum = &h->ip_sum; - pd->proto_sum = NULL; pd->virtual_proto = pd->proto = h->ip_p; pd->tos = h->ip_tos; pd->ttl = h->ip_ttl; @@ -8704,7 +8697,6 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, pd->src = (struct pf_addr *)&h->ip6_src; pd->dst = (struct pf_addr *)&h->ip6_dst; pd->ip_sum = NULL; - pd->proto_sum = NULL; pd->tos = IPV6_DSCP(h); pd->ttl = h->ip6_hlim; pd->tot_len = ntohs(h->ip6_plen) + sizeof(struct ip6_hdr);