Enable strict checking of netlink messages on the nl_req connection,
so it is enabled on both connections.
Also rename the function to remove "_dump" suffix, as it's a generic
option.
Strict checking was originally called NETLINK_DUMP_STRICT_CHK,
but was renamed to NETLINK_GET_STRICT_CHK, as it should apply to
all calls, not only dumps (Linux commmit
d3e8869ec826).
When set on nl_req, we don't need to check the return code, as it will
fail on nl_scan as well, and so one log message should be enough and
unlike nl_scan, we don't need to alter the mode of operation.
}
static int
-nl_set_strict_dump(struct nl_sock *nl UNUSED, int strict UNUSED)
+nl_set_strict_chk(struct nl_sock *nl UNUSED, int strict UNUSED)
{
#ifdef SOL_NETLINK
return setsockopt(nl->fd, SOL_NETLINK, NETLINK_GET_STRICT_CHK, &strict, sizeof(strict));
nl_open_sock(&nl_scan);
nl_open_sock(&nl_req);
- if (nl_set_strict_dump(&nl_scan, 1) < 0)
+ nl_set_strict_chk(&nl_req, 1);
+ if (nl_set_strict_chk(&nl_scan, 1) < 0)
{
log(L_WARN "KRT: Netlink strict checking failed, will scan all tables at once");
krt_use_shared_scan();