From nobody Tue Dec 20 16:23:34 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 4Nc21y4RQ5z1G3lg; Tue, 20 Dec 2022 16:23:34 +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 4Nc21y3mnwz3L07; Tue, 20 Dec 2022 16:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671553414; 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=6F0mvs5nLue0/s2RXFIWtnCTNDgpO4LlgH31t6dMAMw=; b=cttbIZ6DOOmmia69dB6GbIRaMSMd1wsNfpWV2bb34WTvwZSiMYc2z3rcCpF68LwTyXZcoY b4uR2MV9dkPsgFkbHS9K9uXajmYc5qZuMylzdsKwqeVf/f3U3fzLg9GiRmB+3xbEUPUrcn QFu5h4zVuIuX6N4C3Xj/E3p7PnPdlivitk2ct3m3zC3FTZWLeTFZ/vxqdEEwbW8yOlFomb B4VUBMsFe4aMNWgguJsGm7LZXZlqus435hP+4M28i7d6iLrzOZY5+G+LHtkP98aiVuj/dU hJl0zS0lKZe2CezJtqrflmlkHOPpuod8oKol1pdA5vrqH2HOZ6SI39mWsrdhFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671553414; 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=6F0mvs5nLue0/s2RXFIWtnCTNDgpO4LlgH31t6dMAMw=; b=Hfe+NyAZzGmuuMdR9NR2BOW63O8YMHwKifqtOZP34H4HENw6HGcVuwrZDQWYU/FEpv8wA/ k5+BJFa6PuRCcg/rOodvYptqLUUy+VvRCbngxfESnPVumNoWRyy4xuIP8sqRYdrc7D5dyN 0URcXLLgeQwzBmfQaaBi65WQqUqEzST6jhM1YV+wF5htE6DVlO4uW1qJ1pYoN5zJ59sC7s ny9GItb+NX0fDKkIqWmg4ZWNSC5bqNT5oJUdYXogigJLGMt56eIE/TLvghjjToK7Mu9CdW uTG6nLcGDHtf8akYveZRoVRqpzSPr01mb6CnPszvTaObKmB+GnGdGY215Q+POQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671553414; a=rsa-sha256; cv=none; b=fqH++ZcQ1sxU1XH0/tT/VY/yWKkhUYbb/RJ9DBQcvy/trp3NFlKxIo9sP7F6jS9YsPVQU/ xaskfLWwc7StI/NdhY0vZCz0TnMhIYwDZ/b1pFELdA/U5INP+QJIrdoDI+vy0dKt9g1i/m Kof7rYDMiyouoYS/j0dns7x0gGuy+Oj/QJjr9hk+T898bc5HhNAyab5MYQ53EfXpiGt0BI 9x7mO6uQUWbRZkNC1p3+MNPgcegR5p57WxvfKCK8eQjEtkUUUY/Lqvkjnuto8/AaWtkvx1 F8xngOZkK39hpWJ9f6wJsgGJQ+//X7I9yMXF80cgJPOHir1ykRdRWNvpzs+cNg== 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 4Nc21y2pH4zhx7; Tue, 20 Dec 2022 16:23:34 +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 2BKGNYYC020936; Tue, 20 Dec 2022 16:23:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BKGNYj7020935; Tue, 20 Dec 2022 16:23:34 GMT (envelope-from git) Date: Tue, 20 Dec 2022 16:23:34 GMT Message-Id: <202212201623.2BKGNYj7020935@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: e81fcbece8df - main - ipfw: Constify name argument for hash lookup 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: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e81fcbece8df220ce0d072576419a95c6083a0bb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=e81fcbece8df220ce0d072576419a95c6083a0bb commit e81fcbece8df220ce0d072576419a95c6083a0bb Author: Justin Hibbits AuthorDate: 2022-12-16 18:16:52 +0000 Commit: Justin Hibbits CommitDate: 2022-12-20 16:18:49 +0000 ipfw: Constify name argument for hash lookup The name doesn't get modified, and it gets passed through to a hash function that accepts only a const pointer. Const it for correctness. Sponsored by: Juniper Networks, Inc. --- sys/netpfil/ipfw/ip_fw_private.h | 2 +- sys/netpfil/ipfw/ip_fw_sockopt.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_private.h b/sys/netpfil/ipfw/ip_fw_private.h index 1440b1a40eee..87a40c940c23 100644 --- a/sys/netpfil/ipfw/ip_fw_private.h +++ b/sys/netpfil/ipfw/ip_fw_private.h @@ -719,7 +719,7 @@ void ipfw_objhash_bitmap_swap(struct namedobj_instance *ni, void ipfw_objhash_bitmap_free(void *idx, int blocks); void ipfw_objhash_set_hashf(struct namedobj_instance *ni, objhash_hash_f *f); struct named_object *ipfw_objhash_lookup_name(struct namedobj_instance *ni, - uint32_t set, char *name); + uint32_t set, const char *name); struct named_object *ipfw_objhash_lookup_name_type(struct namedobj_instance *ni, uint32_t set, uint32_t type, const char *name); struct named_object *ipfw_objhash_lookup_kidx(struct namedobj_instance *ni, diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c index 8348f8644347..e8dd59eacc09 100644 --- a/sys/netpfil/ipfw/ip_fw_sockopt.c +++ b/sys/netpfil/ipfw/ip_fw_sockopt.c @@ -4395,7 +4395,8 @@ objhash_hash_idx(struct namedobj_instance *ni, uint32_t val) } struct named_object * -ipfw_objhash_lookup_name(struct namedobj_instance *ni, uint32_t set, char *name) +ipfw_objhash_lookup_name(struct namedobj_instance *ni, uint32_t set, + const char *name) { struct named_object *no; uint32_t hash;