diff options
| author | Roy Marples <roy@marples.name> | 2016-06-10 08:56:00 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-06-10 08:56:00 +0000 |
| commit | 432554af2ee051801949bb423de2a70502255c41 (patch) | |
| tree | 7b0094c80e1d34dbdfae4b6fab00f71ed4467246 | |
| parent | 4b49c29a9712b6175306d7672d7c6a3e53c08907 (diff) | |
| download | dhcpcd-432554af2ee051801949bb423de2a70502255c41.tar.xz | |
Only log the once we have logged the delegated prefix.
| -rw-r--r-- | dhcp6.c | 23 | ||||
| -rw-r--r-- | ipv6.h | 3 |
2 files changed, 20 insertions, 6 deletions
@@ -1866,6 +1866,9 @@ dhcp6_findpd(struct interface *ifp, const uint8_t *iaid, continue; } + pltime = 20; + vltime = 30; + TAILQ_FOREACH(a, &state->addrs, next) { if (IN6_ARE_ADDR_EQUAL(&a->prefix, &pdp->prefix)) break; @@ -2476,6 +2479,11 @@ dhcp6_delegate_prefix(struct interface *ifp) ifo = ifp->options; state = D6_STATE(ifp); + /* Clear the logged flag. */ + TAILQ_FOREACH(ap, &state->addrs, next) { + ap->flags &= ~IPV6_AF_DELEGATEDLOG; + } + TAILQ_FOREACH(ifd, ifp->ctx->ifaces, next) { if (!ifd->active) continue; @@ -2484,11 +2492,16 @@ dhcp6_delegate_prefix(struct interface *ifp) TAILQ_FOREACH(ap, &state->addrs, next) { if (!(ap->flags & IPV6_AF_DELEGATEDPFX)) continue; - logger(ifp->ctx, - ap->flags & IPV6_AF_NEW ? LOG_INFO : LOG_DEBUG, - "%s: delegated prefix %s", - ifp->name, ap->saddr); - ap->flags &= ~IPV6_AF_NEW; + if (!(ap->flags & IPV6_AF_DELEGATEDLOG)) { + /* We only want to log this the once as we loop + * through many interfaces first. */ + ap->flags |= IPV6_AF_DELEGATEDLOG; + logger(ifp->ctx, + ap->flags & IPV6_AF_NEW ?LOG_INFO:LOG_DEBUG, + "%s: delegated prefix %s", + ifp->name, ap->saddr); + ap->flags &= ~IPV6_AF_NEW; + } for (i = 0; i < ifo->ia_len; i++) { ia = &ifo->ia[i]; if (memcmp(ia->iaid, ap->iaid, @@ -181,8 +181,9 @@ struct ipv6_addr { #define IPV6_AF_NOREJECT 0x0200 #define IPV6_AF_REQUEST 0x0400 #define IPV6_AF_STATIC 0x0800 +#define IPV6_AF_DELEGATEDLOG 0x1000 #ifdef IPV6_MANAGETEMPADDR -#define IPV6_AF_TEMPORARY 0X1000 +#define IPV6_AF_TEMPORARY 0X2000 #endif struct rt6 { |
