From nobody Tue Dec 03 20:04:54 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 4Y2s7q23ZCz5ggWq; Tue, 03 Dec 2024 20:04:55 +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 4Y2s7q00sbz4lCj; Tue, 3 Dec 2024 20:04:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733256295; 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=I4Vi4IS1ZI4Re0hNUZwfF9oiDfMfo8b6FEhpFtv1hN0=; b=Kw/U1LHD8LpynjkS76aBBxA5zOdFOYdsW8kHAlGzQnh8OkHBkugA+N1J8o84GPxYa++WjP xcpuMGnsp6aJ777CINNriMDky3mG4Xy6fVhPMLMa6R19BgURUb+QvlvcgZdSJXffOfzF86 XzgQR0LYFU7iVPpozLQoGobq/wJVsTbKnAF3kAG3P+56mLvrJpFxFJWvHS2Cs1yIRpSweG 2fV06jE41zGGmNCTOC7IQcIoLlRnHJwKs+xY17WSuqvz9GrH3RsSMAGbzTeRhhFWyf68ak xCZsA8xTy1fPtaYxgQ6AfIOS5KefOqr9wplX7AY3m0Pwf7d7Cju2Z0M2mmDJZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733256295; 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=I4Vi4IS1ZI4Re0hNUZwfF9oiDfMfo8b6FEhpFtv1hN0=; b=cwpy4ZudiJ7Bl/Hb1lDFrvrutVc1y7SMKC1ImHMBVFCeS0mF1bA+T1GjQrXdDHiJJwnHyb Jti/ep+HIns3tqq1yLKG7zJMauJG5HGF3YhxFMf0dB9zc9SPeHj679bNGWkYC7k+FQJYSt Uje/cmxnHik16PBh7m/LdZn/l5X3+PqGJkPNpOZ8AjyX4ueje6dPgcW0Y0cG0PTq0zK3JI WNFkiTyYD5lyzECOy5dtZ/fBlqywZGr4Q/3ZjZczHIKxuEMKI2ULIDhMtlUUX89R+2s0OI iV901jo/olF8+0FqWEZc7qv3mW4KQxQywxFY/eKlhuRs5l7X/SMxJWA9WDg6YQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733256295; a=rsa-sha256; cv=none; b=Sc35yssJ/F+VdDcWhWDb9Jizg+LdGSiiMrhyjFPvMbQKO/wP1CJ0ry5kEXkpoHagIII6KF 1Z1TNhvxBv1hehfjePzegy6QF+s/iRl+jJ5eTbNIzvuXo7g21qOG0+g8hJb0aN/euWSeLY 9b1AqWEKQseTImg4RyOz9EeZKgv0w/JrBgj/jEFZEZxQ7d8qQudSdmxYo73oT9AxW6xgNy ERN/t42hoxQYhMpWqB2xgtd7Jcx5jOYLHaN5eIxgKBPFlFZcVnQLbvtqUTIAkDKlhsfH8T Lk62/u5abg1SuWqUokRvf29yPLR4HDxX1i0qWBJ+h+FXWA+tB82RAS+wwLEsfg== 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 4Y2s7p6cJtzd1G; Tue, 3 Dec 2024 20:04:54 +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 4B3K4s7J061545; Tue, 3 Dec 2024 20:04:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B3K4sh1061542; Tue, 3 Dec 2024 20:04:54 GMT (envelope-from git) Date: Tue, 3 Dec 2024 20:04:54 GMT Message-Id: <202412032004.4B3K4sh1061542@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: ac84ce05c121 - main - netlink: consistently use uint16_t for family id 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac84ce05c121b1f6ff47f0f3302ac26020231d08 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=ac84ce05c121b1f6ff47f0f3302ac26020231d08 commit ac84ce05c121b1f6ff47f0f3302ac26020231d08 Author: Gleb Smirnoff AuthorDate: 2024-12-03 20:04:09 +0000 Commit: Gleb Smirnoff CommitDate: 2024-12-03 20:04:09 +0000 netlink: consistently use uint16_t for family id Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D47547 --- sys/netlink/netlink_ctl.h | 4 ++-- sys/netlink/netlink_domain.c | 2 +- sys/netlink/netlink_generic_kpi.c | 4 ++-- sys/netlink/netlink_var.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netlink/netlink_ctl.h b/sys/netlink/netlink_ctl.h index 90a6cb663810..2d4737b61c40 100644 --- a/sys/netlink/netlink_ctl.h +++ b/sys/netlink/netlink_ctl.h @@ -79,7 +79,7 @@ bool netlink_register_proto(int proto, const char *proto_name, nl_handler_f hand bool netlink_unregister_proto(int proto); /* Common helpers */ -bool nl_has_listeners(int netlink_family, uint32_t groups_mask); +bool nl_has_listeners(uint16_t netlink_family, uint32_t groups_mask); bool nlp_has_priv(struct nlpcb *nlp, int priv); struct ucred *nlp_get_cred(struct nlpcb *nlp); uint32_t nlp_get_pid(const struct nlpcb *nlp); @@ -103,7 +103,7 @@ uint32_t genl_register_group(const char *family_name, const char *group_name); struct genl_family; const char *genl_get_family_name(const struct genl_family *gf); -uint32_t genl_get_family_id(const struct genl_family *gf); +uint16_t genl_get_family_id(const struct genl_family *gf); typedef void (*genl_family_event_handler_t)(void *arg, const struct genl_family *gf, int action); EVENTHANDLER_DECLARE(genl_family_event, genl_family_event_handler_t); diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c index 777aff43000a..7bd58e63b65a 100644 --- a/sys/netlink/netlink_domain.c +++ b/sys/netlink/netlink_domain.c @@ -256,7 +256,7 @@ nl_send_group(struct nl_writer *nw) } bool -nl_has_listeners(int netlink_family, uint32_t groups_mask) +nl_has_listeners(uint16_t netlink_family, uint32_t groups_mask) { return (V_nl_ctl != NULL); } diff --git a/sys/netlink/netlink_generic_kpi.c b/sys/netlink/netlink_generic_kpi.c index b5cf03dd8fc8..4e40bb7dfc49 100644 --- a/sys/netlink/netlink_generic_kpi.c +++ b/sys/netlink/netlink_generic_kpi.c @@ -252,7 +252,7 @@ genl_register_group(const char *family_name, const char *group_name) /* accessors */ struct genl_family * -genl_get_family(uint32_t family_id) +genl_get_family(uint16_t family_id) { return ((family_id < MAX_FAMILIES) ? &families[family_id] : NULL); } @@ -263,7 +263,7 @@ genl_get_family_name(const struct genl_family *gf) return (gf->family_name); } -uint32_t +uint16_t genl_get_family_id(const struct genl_family *gf) { return (gf->family_id); diff --git a/sys/netlink/netlink_var.h b/sys/netlink/netlink_var.h index ddf30b373446..51b0045b1430 100644 --- a/sys/netlink/netlink_var.h +++ b/sys/netlink/netlink_var.h @@ -159,7 +159,7 @@ struct genl_group { const char *group_name; }; -struct genl_family *genl_get_family(uint32_t family_id); +struct genl_family *genl_get_family(uint16_t family_id); struct genl_group *genl_get_group(uint32_t group_id); #define MAX_FAMILIES 20