diff options
| author | Roy Marples <roy@marples.name> | 2016-04-08 09:38:53 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-04-08 09:38:53 +0000 |
| commit | 19e75b953a98aa7990f2abb6c12e21ba9c10cea6 (patch) | |
| tree | b3147ccb9f509e8d265d2f4a04a0624df04a0b10 /ipv6nd.c | |
| parent | 5190ea1695c9248115643b5633ef71110b4d3c10 (diff) | |
| download | dhcpcd-19e75b953a98aa7990f2abb6c12e21ba9c10cea6.tar.xz | |
Log RA's only when it's a new router unless debugging is enabled.
This is because some routers decrease the preferred and valid times
in accordance to their own prefixes and we don't want to needlessly spam
the log.
Fixed [01f7cbd3b1].
Diffstat (limited to 'ipv6nd.c')
| -rw-r--r-- | ipv6nd.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -806,10 +806,6 @@ ipv6nd_handlera(struct dhcpcd_ctx *dctx, struct interface *ifp, new_data = 1; } else new_data = 0; - if (new_data || ifp->options->options & DHCPCD_DEBUG) - logger(ifp->ctx, LOG_INFO, "%s: Router Advertisement from %s", - ifp->name, ctx->sfrom); - if (rap == NULL) { rap = calloc(1, sizeof(*rap)); if (rap == NULL) { @@ -835,6 +831,14 @@ ipv6nd_handlera(struct dhcpcd_ctx *dctx, struct interface *ifp, rap->data_len = len; } + /* We could change the debug level based on new_data, but some + * routers like to decrease the advertised valid and preferred times + * in accordance with the own prefix times which would result in too + * much needless log spam. */ + logger(ifp->ctx, new_rap ? LOG_INFO : LOG_DEBUG, + "%s: Router Advertisement from %s", + ifp->name, ctx->sfrom); + clock_gettime(CLOCK_MONOTONIC, &rap->acquired); rap->flags = nd_ra->nd_ra_flags_reserved; rap->lifetime = ntohs(nd_ra->nd_ra_router_lifetime); |
