{
struct interface *ifp;
struct dhcp6_state *state;
+ int llevel;
ifp = arg;
state = D6_STATE(ifp);
if (state->reason == NULL || strcmp(state->reason, "TIMEOUT6") != 0)
dhcp6_delete_delegates(ifp);
#endif
- loginfox("%s: soliciting a DHCPv6 lease", ifp->name);
+ if (state->new == NULL && !state->failed)
+ llevel = LOG_INFO;
+ else
+ llevel = LOG_DEBUG;
+ logmessage(llevel, "%s: soliciting a DHCPv6 lease", ifp->name);
state->state = DH6S_DISCOVER;
state->RTC = 0;
state->IMD = SOL_MAX_DELAY;
{
struct interface *ifp;
struct dhcp6_state *state;
+ int llevel;
ifp = arg;
state = D6_STATE(ifp);
- if (state->new == NULL || ifp->options->options & DHCPCD_DEBUG)
- loginfox("%s: requesting DHCPv6 information", ifp->name);
+ if (state->new == NULL && !state->failed)
+ llevel = LOG_INFO;
+ else
+ llevel = LOG_DEBUG;
+ logmessage(llevel, "%s: requesting DHCPv6 information", ifp->name);
state->state = DH6S_INFORM;
state->RTC = 0;
state->IMD = INF_MAX_DELAY;
{
struct dhcp6_state *state = D6_STATE(ifp);
+ state->failed = true;
+
/* RFC3315 18.1.2 says that prior addresses SHOULD be used on failure.
* RFC2131 3.2.3 says that MAY chose to use the prior address.
* Because dhcpcd was written first for RFC2131, we have the LASTLEASE
}
}
+static int
+dhcp6_failloglevel(struct interface *ifp)
+{
+ const struct dhcp6_state *state = D6_CSTATE(ifp);
+
+ return state->failed ? LOG_DEBUG : LOG_ERR;
+}
+
static void
dhcp6_failconfirm(void *arg)
{
- struct interface *ifp;
+ struct interface *ifp = arg;
+ int llevel = dhcp6_failloglevel(ifp);
- ifp = arg;
- logerrx("%s: failed to confirm prior address", ifp->name);
+ logmessage(llevel, "%s: failed to confirm prior DHCPv6 address",
+ ifp->name);
dhcp6_fail(ifp);
}
static void
dhcp6_failrequest(void *arg)
{
- struct interface *ifp;
+ struct interface *ifp = arg;
+ int llevel = dhcp6_failloglevel(ifp);
- ifp = arg;
- logerrx("%s: failed to request address", ifp->name);
+ logmessage(llevel, "%s: failed to request DHCPv6 address", ifp->name);
dhcp6_fail(ifp);
}
static void
dhcp6_failinform(void *arg)
{
- struct interface *ifp;
+ struct interface *ifp = arg;
+ int llevel = dhcp6_failloglevel(ifp);
- ifp = arg;
- logerrx("%s: failed to request information", ifp->name);
+ logmessage(llevel, "%s: failed to request DHCPv6 information",
+ ifp->name);
dhcp6_fail(ifp);
}
static void
dhcp6_failrebind(void *arg)
{
- struct interface *ifp;
+ struct interface *ifp = arg;
- ifp = arg;
- logerrx("%s: failed to rebind prior delegation", ifp->name);
+ logerrx("%s: failed to rebind prior DHCPv6 delegation", ifp->name);
dhcp6_fail(ifp);
}
state->state = DH6S_INFORMED;
else
state->state = DH6S_BOUND;
+ state->failed = false;
if (state->renew && state->renew != ND6_INFINITE_LIFETIME)
eloop_timeout_add_sec(ifp->ctx->eloop,
gogogo:
state->state = init_state;
state->lerror = 0;
+ state->failed = false;
dhcp_set_leasefile(state->leasefile, sizeof(state->leasefile),
AF_INET6, ifp);
if (ipv6_linklocal(ifp) == NULL) {