From nobody Fri Sep 01 18:18:12 2023 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 4RcmVY2RFMz4s0YS; Fri, 1 Sep 2023 18:18:13 +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 4RcmVY0Lysz4GwZ; Fri, 1 Sep 2023 18:18:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693592293; 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=Jx2mmnTTORIvDtWCWVDCjF3G22iFtJ7HhIezkstUSxo=; b=Ir2gZtmu4SGOOQs8RLVzMx4mmw81CGQZzx2bv5oZr7wL9SMIMFLyOV9RV+JurG9XW97mH/ +8v4ylBeSINtJQIeW/WN3SKjq5hIz0ToB1VIZTDVRCwC3J5IiNFgJMYCuE5pgTIemfrVgD kg5Qa3D+8IZhw49dzpsobwP51uBs84mAhbh3/8o0ww0O64HUTd/HbEnXZJAdxKIs+BdUk7 x+6AYX3ZR+iIBxZumHo0EXZCYPMoBFJaI2rSFavXux24McG6Sw5lUlNc2VD4vNv4Aai6od zKcquz+rzZaRexZPzXAIq7K1vmRnoJ7Cy0X4rQf4Kz98G67Gv5TwNhRy3ivR5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693592293; a=rsa-sha256; cv=none; b=o/DFsqT3LaL2fmScmqsnCz3Na7DejvPx+JA+70HVLvSqUFVrk563BBr/MX42Yc9slmklz8 oDDisRFSJ94faX5HR9wSHJqAuY0ZzjAR3NhQ0dVM38oUIwdO9QZNZl8hiRF02NkYiPfcOw 0niyGvS0xeZBIIdMGDn1dkTWj2IxdhVlabo8mhuKoLLNUmtltTZUByz2iHz3szabcYmGIf HK9WzP3qObLIfHdzpWP5rP9pcTGsKSeXT/RjlSBM93qVrnRVE5YEL4IJYWiaOw1uKACpXy y94fn2eVfxaUet+a6tzLsUVBdWe+V77GxpJjxUIi2p62PD9t1jce+o8YElm0sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693592293; 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=Jx2mmnTTORIvDtWCWVDCjF3G22iFtJ7HhIezkstUSxo=; b=Zf6ZDE0C2UB4DFOjYnKZDfG7W8MSv8akMLYf3U97HWHhf5aBWAlUPT94qJwtadBTYHLQWT tfEXJOa5h0vkTpry6FJKv4SRreS58qj/9xvqbu1sEDVtDxp8ybcO5IWvzHiYQY5mQSSFMk xvcmZk7ouNhLkfYtlbTX/VeLr5FVZ6MDR/1EdHhHVWdZtgFo+VkPdET+9CI9D6odYbUSSg Vs6zOLlZtHEMnwEXY2U8NvVNnIGfrWBoxSMOtcrXhbzNECyfT5GB1099rNfCZ85JdksAAV SUBfIlKoY+R2+BKnzOVHInYFECfJ45hYDo1xHLCxkuWY2DfKAZZwMOkQLYUfHg== 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 4RcmVX6PtSz19jk; Fri, 1 Sep 2023 18:18:12 +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 381IICuB005376; Fri, 1 Sep 2023 18:18:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 381IICVO005373; Fri, 1 Sep 2023 18:18:12 GMT (envelope-from git) Date: Fri, 1 Sep 2023 18:18:12 GMT Message-Id: <202309011818.381IICVO005373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: b2a48c3cf86d - main - pf: retire pf_krule_to_rule and pf_kpool_to_pool 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: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2a48c3cf86d8593f42072c3df74f2f708fbd93b Auto-Submitted: auto-generated The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b2a48c3cf86d8593f42072c3df74f2f708fbd93b commit b2a48c3cf86d8593f42072c3df74f2f708fbd93b Author: Mateusz Guzik AuthorDate: 2023-09-01 18:12:41 +0000 Commit: Mateusz Guzik CommitDate: 2023-09-01 18:18:02 +0000 pf: retire pf_krule_to_rule and pf_kpool_to_pool Discussed with: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 115 ---------------------------------------------- 1 file changed, 115 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 44ede3dea6a3..8dbc8986e7d3 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1877,20 +1877,6 @@ pf_pooladdr_to_kpooladdr(const struct pf_pooladdr *pool, return (ret); } -static void -pf_kpool_to_pool(const struct pf_kpool *kpool, struct pf_pool *pool) -{ - bzero(pool, sizeof(*pool)); - - bcopy(&kpool->key, &pool->key, sizeof(pool->key)); - bcopy(&kpool->counter, &pool->counter, sizeof(pool->counter)); - - pool->tblidx = kpool->tblidx; - pool->proxy_port[0] = kpool->proxy_port[0]; - pool->proxy_port[1] = kpool->proxy_port[1]; - pool->opts = kpool->opts; -} - static void pf_pool_to_kpool(const struct pf_pool *pool, struct pf_kpool *kpool) { @@ -1906,107 +1892,6 @@ pf_pool_to_kpool(const struct pf_pool *pool, struct pf_kpool *kpool) kpool->opts = pool->opts; } -static void -pf_krule_to_rule(const struct pf_krule *krule, struct pf_rule *rule) -{ - - bzero(rule, sizeof(*rule)); - - bcopy(&krule->src, &rule->src, sizeof(rule->src)); - bcopy(&krule->dst, &rule->dst, sizeof(rule->dst)); - - for (int i = 0; i < PF_SKIP_COUNT; ++i) { - if (rule->skip[i].ptr == NULL) - rule->skip[i].nr = -1; - else - rule->skip[i].nr = krule->skip[i].ptr->nr; - } - - strlcpy(rule->label, krule->label[0], sizeof(rule->label)); - strlcpy(rule->ifname, krule->ifname, sizeof(rule->ifname)); - strlcpy(rule->qname, krule->qname, sizeof(rule->qname)); - strlcpy(rule->pqname, krule->pqname, sizeof(rule->pqname)); - strlcpy(rule->tagname, krule->tagname, sizeof(rule->tagname)); - strlcpy(rule->match_tagname, krule->match_tagname, - sizeof(rule->match_tagname)); - strlcpy(rule->overload_tblname, krule->overload_tblname, - sizeof(rule->overload_tblname)); - - pf_kpool_to_pool(&krule->rpool, &rule->rpool); - - rule->evaluations = pf_counter_u64_fetch(&krule->evaluations); - for (int i = 0; i < 2; i++) { - rule->packets[i] = pf_counter_u64_fetch(&krule->packets[i]); - rule->bytes[i] = pf_counter_u64_fetch(&krule->bytes[i]); - } - - /* kif, anchor, overload_tbl are not copied over. */ - - rule->os_fingerprint = krule->os_fingerprint; - - rule->rtableid = krule->rtableid; - bcopy(krule->timeout, rule->timeout, sizeof(krule->timeout)); - rule->max_states = krule->max_states; - rule->max_src_nodes = krule->max_src_nodes; - rule->max_src_states = krule->max_src_states; - rule->max_src_conn = krule->max_src_conn; - rule->max_src_conn_rate.limit = krule->max_src_conn_rate.limit; - rule->max_src_conn_rate.seconds = krule->max_src_conn_rate.seconds; - rule->qid = krule->qid; - rule->pqid = krule->pqid; - rule->nr = krule->nr; - rule->prob = krule->prob; - rule->cuid = krule->cuid; - rule->cpid = krule->cpid; - - rule->return_icmp = krule->return_icmp; - rule->return_icmp6 = krule->return_icmp6; - rule->max_mss = krule->max_mss; - rule->tag = krule->tag; - rule->match_tag = krule->match_tag; - rule->scrub_flags = krule->scrub_flags; - - bcopy(&krule->uid, &rule->uid, sizeof(krule->uid)); - bcopy(&krule->gid, &rule->gid, sizeof(krule->gid)); - - rule->rule_flag = krule->rule_flag; - rule->action = krule->action; - rule->direction = krule->direction; - rule->log = krule->log; - rule->logif = krule->logif; - rule->quick = krule->quick; - rule->ifnot = krule->ifnot; - rule->match_tag_not = krule->match_tag_not; - rule->natpass = krule->natpass; - - rule->keep_state = krule->keep_state; - rule->af = krule->af; - rule->proto = krule->proto; - rule->type = krule->type; - rule->code = krule->code; - rule->flags = krule->flags; - rule->flagset = krule->flagset; - rule->min_ttl = krule->min_ttl; - rule->allow_opts = krule->allow_opts; - rule->rt = krule->rt; - rule->return_ttl = krule->return_ttl; - rule->tos = krule->tos; - rule->set_tos = krule->set_tos; - rule->anchor_relative = krule->anchor_relative; - rule->anchor_wildcard = krule->anchor_wildcard; - - rule->flush = krule->flush; - rule->prio = krule->prio; - rule->set_prio[0] = krule->set_prio[0]; - rule->set_prio[1] = krule->set_prio[1]; - - bcopy(&krule->divert, &rule->divert, sizeof(krule->divert)); - - rule->u_states_cur = counter_u64_fetch(krule->states_cur); - rule->u_states_tot = counter_u64_fetch(krule->states_tot); - rule->u_src_nodes = counter_u64_fetch(krule->src_nodes); -} - static int pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) {