From nobody Mon Jan 23 22:12:12 2023 X-Original-To: dev-commits-src-branches@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 4P148Y0J5fz2t0Zg; Mon, 23 Jan 2023 22:12: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 4P148X5tTJz3M7j; Mon, 23 Jan 2023 22:12:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674511932; 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=3WYE9fkWK1vVMJdsOUZcwOmVQiVWTQSCcskvDKZD7Y0=; b=IaGn0sDioObD0DhCKrbUW7gjwDHS2PlAZ++dyIxi7mO5ixqDVsMEVhGR7K3f5cPkaK7nE+ PbS1ToRAlxt+zvZEwRu+KKoec5gXdT/gQZXfjnzteCOPo4l0SlGocS5f28gn4Z8v6V0NF7 zBNDKRmZOaRyKLXYoMBg620M/rsTuCYTL1bP5uvhOxtbsfOXNloF1719KjaTnq60jOYa+L qNCal1D2kDteiHN/GYs042RrCNi7LZ9lVkjR21ZsDACxokl+k0aKa1wzJjbmy6NlCd80Fa wsJ6pWq1qmdIOlXiq50MYUHqCQ9nHitB92fbL7H9+dofkD5unQR4y4gK4hFwig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674511932; 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=3WYE9fkWK1vVMJdsOUZcwOmVQiVWTQSCcskvDKZD7Y0=; b=ZtCo5aAlE7e4QRsNDSnAyYu7J+YdoNATaZG/psdDnk+6kWPmlqInvk4K5NgNucoj74WkNj 3oONj9PvawCDIxW2Sj811IscoqhnIT1x7tIbOzzRJNR+6rWrVNxHucdZMen3gB86xLVGv1 +YwJx2vsmO618I/8MZ7Sh4FdW3ZjDPxfJxP9nU4XslyhwHUKHKCfwcnBRNy6e4MKW6QBkx sUCRyXHCZLSCBrJqnPmzn8f5AK4UjapdVksJF8+k6Gqa8niT/OzGYapo03lT/Jf8ORNdFM 5vjrB++2ragy+3NkzRNUTIWmVwoGjIxdlg91Q35CVTI7swUsJMykwMuI8DMAzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674511932; a=rsa-sha256; cv=none; b=eUMb9S9Dj1eSp1uFQMd6skPkt2N3w9lV3l5/2JsdwhLGG7L4wNr7o6G4TXMqsOSXKKdz7k xw3kuQwI1lv/xSu0MPm5Ygpk2mbvYsr/sMbonmRena/IfXImS3dux1w/tQZZVKpKvpi9J7 9jj7ydT78BSxQ9xYZPjpeio4uSIsFngwAaAPaQexQlZNwM8leFle6M9HByBWmrEFJLTIMb +slRAP9Y+Yb+PEAaXsMHSPwSGF1x0V8N3J7muBCj0J4RFOcUXfnUX2NZDdBIpM2dk6PNiY kw741cgFWZIo7Ro5jDYAYWjCone4o3HrYPRhLl09cUIbTjTMIgz3uUJo5vIyDA== 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 4P148X4j0zzlnn; Mon, 23 Jan 2023 22:12:12 +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 30NMCCnh015646; Mon, 23 Jan 2023 22:12:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30NMCC9F015633; Mon, 23 Jan 2023 22:12:12 GMT (envelope-from git) Date: Mon, 23 Jan 2023 22:12:12 GMT Message-Id: <202301232212.30NMCC9F015633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: f8175ea00f84 - stable/13 - netlink: fix test-includes broken by f2c8381fce9b List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f8175ea00f8441c14115efc013e9d45115dc0e7a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=f8175ea00f8441c14115efc013e9d45115dc0e7a commit f8175ea00f8441c14115efc013e9d45115dc0e7a Author: Alexander V. Chernikov AuthorDate: 2022-12-23 17:57:09 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-01-23 22:09:04 +0000 netlink: fix test-includes broken by f2c8381fce9b Reported by: many (cherry picked from commit c89209c674f2c867a2a3a4cccd4760311399d7e4) --- 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;