]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
DHCP: always log inform when not renewing
authorRoy Marples <roy@marples.name>
Fri, 15 May 2020 14:34:16 +0000 (15:34 +0100)
committerRoy Marples <roy@marples.name>
Fri, 15 May 2020 14:34:16 +0000 (15:34 +0100)
So that we log a new lease on rebind from a renew failure.

src/dhcp.c
src/dhcp6.c

index 08f85c9ae74c26de425de6aa08881190748ad7a4..dba0f1ed374b5130cc399787b54361f4a2f7d9a2 100644 (file)
@@ -2230,7 +2230,7 @@ dhcp_bind(struct interface *ifp)
                                    "rebind time, forcing to %"PRIu32" seconds",
                                    ifp->name, lease->renewaltime);
                        }
-                       if (state->addr &&
+                       if (state->state == DHS_RENEW && state->addr &&
                            lease->addr.s_addr == state->addr->addr.s_addr &&
                            !(state->added & STATE_FAKE))
                                logdebugx("%s: leased %s for %"PRIu32" seconds",
index 6bc3e62750198eb28d4f3d03310da7c41487d550..57f1a57be05b29209b6299a41bc594bc70447674 100644 (file)
@@ -3051,7 +3051,7 @@ dhcp6_bind(struct interface *ifp, const char *op, const char *sfrom)
                        break;
                }
        }
-       loglevel = has_new ? LOG_INFO : LOG_DEBUG;
+       loglevel = has_new || state->state != DH6S_RENEW ? LOG_INFO : LOG_DEBUG;
        if (!timedout) {
                logmessage(loglevel, "%s: %s received from %s",
                    ifp->name, op, sfrom);