From nobody Fri Dec 23 17:58:24 2022 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 4Ndw006RDMz1HG5n; Fri, 23 Dec 2022 17:58:24 +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 4Ndw005r7xz4KPg; Fri, 23 Dec 2022 17:58:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671818304; 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=RYUFgRKC1pteOu/i0JVAXOu8tdKV4yQxKy2Iiivuaew=; b=uQJ/3WkYzeHtf3R3DASHVYW9XvAHV3Zd0+Jo7MAYrS/pc66OtH2RtuACrzMcqXJmLkloLI Jrax1mtAzYjVsL7rkfDVlYSRpWId+oY24s+0s2h6v3c2PDrVOtVxo6l0W5enX4yxb3aM9F KagKqi/mcKJXJPlPhT0Lq7pppRqnDJfsLe5teoqMgct4VMQ6pkiVWwhPB7MLwoCK7VwliI burgEXxoKxNA1Hlz02OQLPYpFiQrhT86Ks3d2mVpEoJIi+jVgfHLj4Poep20JHp1v+9HdH pueWtqlmqPI6VpWCgwepky5E0jXd2XKN1U2qFUqV4YoK86mhcvXCG+AYfGyTvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671818304; 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=RYUFgRKC1pteOu/i0JVAXOu8tdKV4yQxKy2Iiivuaew=; b=kgK+8ZmFshD95lXxCS8E7sGnNuGYnc8R/6OnhbMvVXrZXwndtJjzxH/+0qaWNlO1+Ur89k 48rIBtPwbuvX8z5mHrWJgIBMGK/+YrpBaVRpOpzdJzleJqJDrwFt7zx3sXCZpnKE5bhIGf qQhd+cTlDtjbKMAZbRM+qrdd/UYAeIWT/9ec2+VJXRTWBK08cLtSdqMLzk9fK0PRoPmBg4 hmM+BTTNXeGAzR0gO8t8aOLn2DYWpnbv/O3CxFSnDbNyga14y4WMqhGJwzipAwugs9yBqT dqwwa20iOA3pFZuC7JtDWfDcg91KH2VFy7VwpuvcE61UyVxGAXnQjvt/O54b/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671818304; a=rsa-sha256; cv=none; b=VeZz7dwV+HIMmMKLVJLzrLAT/iTXQeA581UUT5TJB5nEn+j9bMjcBGKvKMPYUnr440FItS uXcHZ6mLpsjmYlLZlvt6GST9/oivoB64SMEVyCXNKWeNi/3S95vFrzLocds3dKl0++L+v3 pquz9QBv/y43ZmqPzZc++D4vrptUSGqS7SyYZ5gs2UBsJCjZw2puH9+2lSZUt9yyiYQQjd 464rZsK2+mOtlUIyCUOV6ngIhFkxmUMdJjYJe7g6gE6ZijR5G+vwJ/knxpacRmj9vTif70 TYWjNfrVsc8ZrnFoEsJ6Foh5ln8WguO7fUNX8bq6MpEzQuUlhgaEEVj4QICwZA== 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 4Ndw004g4VzjcR; Fri, 23 Dec 2022 17:58:24 +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 2BNHwOTF026142; Fri, 23 Dec 2022 17:58:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BNHwOrD026141; Fri, 23 Dec 2022 17:58:24 GMT (envelope-from git) Date: Fri, 23 Dec 2022 17:58:24 GMT Message-Id: <202212231758.2BNHwOrD026141@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: c89209c674f2 - main - netlink: fix test-includes broken by f2c8381fce9b 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c89209c674f2c867a2a3a4cccd4760311399d7e4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=c89209c674f2c867a2a3a4cccd4760311399d7e4 commit c89209c674f2c867a2a3a4cccd4760311399d7e4 Author: Alexander V. Chernikov AuthorDate: 2022-12-23 17:57:09 +0000 Commit: Alexander V. Chernikov CommitDate: 2022-12-23 17:58:08 +0000 netlink: fix test-includes broken by f2c8381fce9b Reported by: many --- sys/netlink/netlink_snl.h | 34 +++++++++++++++++++--------------- sys/netlink/netlink_snl_route.h | 12 ++++++------ 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index 1fafa37c6dcc..6e2c4b89a7c4 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -58,7 +58,7 @@ #define NLA_TYPE(_nla) ((_nla)->nla_type & 0x3FFF) -#define NLA_NEXT(_attr) (struct nlattr *)((char *)_attr + NLA_ALIGN(_attr->nla_len)) +#define NLA_NEXT(_attr) (struct nlattr *)(void *)((char *)_attr + NLA_ALIGN(_attr->nla_len)) #define _NLA_END(_start, _len) ((char *)(_start) + (_len)) #define NLA_FOREACH(_attr, _start, _len) \ @@ -241,7 +241,7 @@ snl_read_message(struct snl_state *ss) return (NULL); } } - struct nlmsghdr *hdr = (struct nlmsghdr *)&ss->buf[ss->off]; + struct nlmsghdr *hdr = (struct nlmsghdr *)(void *)&ss->buf[ss->off]; ss->off += NLMSG_ALIGN(hdr->nlmsg_len); return (hdr); } @@ -313,7 +313,7 @@ snl_parse_attrs(struct snl_state *ss, struct nlmsghdr *hdr, int hdrlen, { int off = NLMSG_HDRLEN + NETLINK_ALIGN(hdrlen); int len = hdr->nlmsg_len - off; - struct nlattr *nla_head = (struct nlattr *)((char *)hdr + off); + struct nlattr *nla_head = (struct nlattr *)(void *)((char *)hdr + off); return (snl_parse_attrs_raw(ss, nla_head, len, ps, pslen, target)); } @@ -331,7 +331,7 @@ snl_parse_header(struct snl_state *ss, void *hdr, int len, fp->cb(ss, src, dst); } - struct nlattr *nla_head = (struct nlattr *)((char *)hdr + parser->hdr_off); + struct nlattr *nla_head = (struct nlattr *)(void *)((char *)hdr + parser->hdr_off); bool result = snl_parse_attrs_raw(ss, nla_head, len - parser->hdr_off, parser->np, parser->np_size, target); @@ -346,7 +346,7 @@ snl_parse_nlmsg(struct snl_state *ss, struct nlmsghdr *hdr, } static inline bool -snl_attr_get_flag(struct snl_state *ss, struct nlattr *nla, void *target) +snl_attr_get_flag(struct snl_state *ss __unused, struct nlattr *nla, void *target) { if (NLA_DATA_LEN(nla) == 0) { *((uint8_t *)target) = 1; @@ -356,27 +356,30 @@ snl_attr_get_flag(struct snl_state *ss, struct nlattr *nla, void *target) } static inline bool -snl_attr_get_uint16(struct snl_state *ss, struct nlattr *nla, const void *arg, void *target) +snl_attr_get_uint16(struct snl_state *ss __unused, struct nlattr *nla, + const void *arg __unused, void *target) { if (NLA_DATA_LEN(nla) == sizeof(uint16_t)) { - *((uint16_t *)target) = *((const uint16_t *)NL_RTA_DATA_CONST(nla)); + *((uint16_t *)target) = *((const uint16_t *)NLA_DATA_CONST(nla)); return (true); } return (false); } static inline bool -snl_attr_get_uint32(struct snl_state *ss, struct nlattr *nla, const void *arg, void *target) +snl_attr_get_uint32(struct snl_state *ss __unused, struct nlattr *nla, + const void *arg __unused, void *target) { if (NLA_DATA_LEN(nla) == sizeof(uint32_t)) { - *((uint32_t *)target) = *((const uint32_t *)NL_RTA_DATA_CONST(nla)); + *((uint32_t *)target) = *((const uint32_t *)NLA_DATA_CONST(nla)); return (true); } return (false); } static inline bool -snl_attr_get_string(struct snl_state *ss, struct nlattr *nla, const void *arg, void *target) +snl_attr_get_string(struct snl_state *ss __unused, struct nlattr *nla, + const void *arg __unused, void *target) { size_t maxlen = NLA_DATA_LEN(nla); @@ -388,7 +391,8 @@ snl_attr_get_string(struct snl_state *ss, struct nlattr *nla, const void *arg, v } static inline bool -snl_attr_get_stringn(struct snl_state *ss, struct nlattr *nla, const void *arg, void *target) +snl_attr_get_stringn(struct snl_state *ss, struct nlattr *nla, + const void *arg __unused, void *target) { int maxlen = NLA_DATA_LEN(nla); @@ -412,26 +416,26 @@ snl_attr_get_nested(struct snl_state *ss, struct nlattr *nla, const void *arg, v } static inline bool -snl_attr_get_nla(struct snl_state *ss, struct nlattr *nla, void *target) +snl_attr_get_nla(struct snl_state *ss __unused, struct nlattr *nla, void *target) { *((struct nlattr **)target) = nla; return (true); } static inline void -snl_field_get_uint8(struct snl_state *ss, void *src, void *target) +snl_field_get_uint8(struct snl_state *ss __unused, void *src, void *target) { *((uint8_t *)target) = *((uint8_t *)src); } static inline void -snl_field_get_uint16(struct snl_state *ss, void *src, void *target) +snl_field_get_uint16(struct snl_state *ss __unused, void *src, void *target) { *((uint16_t *)target) = *((uint16_t *)src); } static inline void -snl_field_get_uint32(struct snl_state *ss, void *src, void *target) +snl_field_get_uint32(struct snl_state *ss __unused, void *src, void *target) { *((uint32_t *)target) = *((uint32_t *)src); } diff --git a/sys/netlink/netlink_snl_route.h b/sys/netlink/netlink_snl_route.h index 34dfb00a09cd..4adb3d697ecd 100644 --- a/sys/netlink/netlink_snl_route.h +++ b/sys/netlink/netlink_snl_route.h @@ -35,14 +35,12 @@ * Simple Netlink Library - NETLINK_ROUTE helpers */ -#define snl_alloc_sockaddr(_ss, _len) ((struct sockaddr *)(snl_allocz(_ss, _len))) - static inline struct sockaddr * parse_rta_ip4(struct snl_state *ss, void *rta_data, int *perror) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)snl_alloc_sockaddr(ss, sizeof(struct sockaddr_in)); + sin = (struct sockaddr_in *)snl_allocz(ss, sizeof(struct sockaddr_in)); if (sin == NULL) { *perror = ENOBUFS; return (NULL); @@ -58,7 +56,7 @@ parse_rta_ip6(struct snl_state *ss, void *rta_data, int *perror) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)snl_alloc_sockaddr(ss, sizeof(struct sockaddr_in6)); + sin6 = (struct sockaddr_in6 *)snl_allocz(ss, sizeof(struct sockaddr_in6)); if (sin6 == NULL) { *perror = ENOBUFS; return (NULL); @@ -87,7 +85,8 @@ parse_rta_ip(struct snl_state *ss, struct rtattr *rta, int *perror) } static inline bool -snl_attr_get_ip(struct snl_state *ss, struct nlattr *nla, const void *arg, void *target) +snl_attr_get_ip(struct snl_state *ss, struct nlattr *nla, + const void *arg __unused, void *target) { int error = 0; struct sockaddr *sa = parse_rta_ip(ss, (struct rtattr *)nla, &error); @@ -115,7 +114,8 @@ parse_rta_via(struct snl_state *ss, struct rtattr *rta, int *perror) } static inline bool -snl_attr_get_ipvia(struct snl_state *ss, struct nlattr *nla, const void *arg, void *target) +snl_attr_get_ipvia(struct snl_state *ss, struct nlattr *nla, + const void *arg __unused, void *target) { int error = 0;