]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcp6: log debug inform requests when the prior action failed
authorRoy Marples <roy@marples.name>
Mon, 24 Apr 2023 10:53:54 +0000 (11:53 +0100)
committerRoy Marples <roy@marples.name>
Mon, 24 Apr 2023 10:53:54 +0000 (11:53 +0100)
This should reduce log spam without debug for badly configured networks.
Fixes #80.

src/dhcp6.c

index 1131f70f1c685f0a795b256a5c725439b3fa75b6..e7767ca744c9304e9519ffddc0dd116abf82b274 100644 (file)
@@ -1667,10 +1667,7 @@ dhcp6_startinform(void *arg)
 
        ifp = arg;
        state = D6_STATE(ifp);
-       if (state->new_start || (state->new == NULL && !state->failed))
-               llevel = LOG_INFO;
-       else
-               llevel = LOG_DEBUG;
+       llevel = state->failed ? LOG_DEBUG : LOG_INFO;
        logmessage(llevel, "%s: requesting DHCPv6 information", ifp->name);
        state->state = DH6S_INFORM;
        state->RTC = 0;
@@ -3069,7 +3066,7 @@ dhcp6_bind(struct interface *ifp, const char *op, const char *sfrom)
        int loglevel;
        struct timespec now;
 
-       if (state->state == DH6S_RENEW && !state->new_start) {
+       if (state->state == DH6S_RENEW) {
                loglevel = LOG_DEBUG;
                TAILQ_FOREACH(ia, &state->addrs, next) {
                        if (ia->flags & IPV6_AF_NEW) {
@@ -3968,8 +3965,10 @@ dhcp6_start(struct interface *ifp, enum DH6S init_state)
                        {
                                /* We don't want log spam when the RA
                                 * has just adjusted it's prefix times. */
-                               if (state->state != DH6S_INFORMED)
+                               if (state->state != DH6S_INFORMED) {
                                        state->new_start = true;
+                                       state->failed = false;
+                               }
                                dhcp6_startinform(ifp);
                        }
                        break;