1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Rate limit for most abundant log messages

This commit is contained in:
Ondrej Zajicek
2009-02-26 14:23:54 +01:00
parent a9dc5e1ef2
commit cb53039271
7 changed files with 70 additions and 17 deletions

View File

@@ -129,6 +129,8 @@ nl_get_reply(void)
}
}
static struct rate_limit rl_netlink_err;
static int
nl_error(struct nlmsghdr *h)
{
@@ -143,7 +145,7 @@ nl_error(struct nlmsghdr *h)
e = (struct nlmsgerr *) NLMSG_DATA(h);
ec = -e->error;
if (ec)
log(L_WARN "Netlink: %s", strerror(ec));
log_rl(&rl_netlink_err, L_WARN "Netlink: %s", strerror(ec));
return ec;
}