git: 03994c24da95 - main - netlink: fix build without INVARIANTS
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 01 Oct 2022 21:21:32 UTC
The branch main has been updated by melifaro:
URL: https://cgit.FreeBSD.org/src/commit/?id=03994c24da957ffd6556096cdd6f6522eb968ba8
commit 03994c24da957ffd6556096cdd6f6522eb968ba8
Author: Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2022-10-01 21:20:50 +0000
Commit: Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2022-10-01 21:20:50 +0000
netlink: fix build without INVARIANTS
Reported by: cy
---
sys/netlink/netlink_message_parser.h | 2 ++
1 file changed, 2 insertions(+)
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))