From: Roy Marples Date: Sat, 30 May 2020 14:01:47 +0000 (+0000) Subject: route: improve overflow logging X-Git-Tag: v9.1.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84351b6e6c41da40c0ed6f4513230e35268ac569;p=thirdparty%2Fdhcpcd.git route: improve overflow logging --- diff --git a/src/dhcpcd.c b/src/dhcpcd.c index d8f90626..63615ef1 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -1189,12 +1189,10 @@ dhcpcd_linkoverflow(struct dhcpcd_ctx *ctx) rcnt = 0; do { rlen = read(ctx->link_fd, buf, sizeof(buf)); - if (++rcnt == 100) { + if (++rcnt % 1000 == 0) logwarnx("drained %zu messages", rcnt); - rcnt = 0; - } } while (rlen != -1 || errno == ENOBUFS || errno == ENOMEM); - if (rcnt != 100) + if (rcnt % 1000 != 0) logwarnx("drained %zu messages", rcnt); /* Work out the current interfaces. */