aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2022-10-01 21:20:50 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2022-10-01 21:20:50 +0000
commit03994c24da957ffd6556096cdd6f6522eb968ba8 (patch)
tree2105b4930d6e8c11161f3761c4f11f18008eb9ee
parent8d9f3e05728ecef4e21672dd8a54066b17b62a50 (diff)
netlink: fix build without INVARIANTS
Reported by: cy
-rw-r--r--sys/netlink/netlink_message_parser.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netlink/netlink_message_parser.h b/sys/netlink/netlink_message_parser.h
index 2f802b0961ad..b23b223ef80e 100644
--- a/sys/netlink/netlink_message_parser.h
+++ b/sys/netlink/netlink_message_parser.h
@@ -249,6 +249,7 @@ nl_parse_nested(struct nlattr *nla, const struct nlhdr_parser *parser,
static inline void
nl_verify_parsers(const struct nlhdr_parser **parser, int count)
{
+#ifdef INVARIANTS
for (int i = 0; i < count; i++) {
const struct nlhdr_parser *p = parser[i];
int attr_type = 0;
@@ -257,6 +258,7 @@ nl_verify_parsers(const struct nlhdr_parser **parser, int count)
attr_type = p->np[j].type;
}
}
+#endif
}
void nl_verify_parsers(const struct nlhdr_parser **parser, int count);
#define NL_VERIFY_PARSERS(_p) nl_verify_parsers((_p), NL_ARRAY_LEN(_p))