From: Roy Marples Date: Wed, 1 Apr 2015 22:53:00 +0000 (+0000) Subject: Avoid printing the leasefile on error with a valid interface. X-Git-Tag: v6.8.2~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b8e154a1c4fa5745712d2bb7ade5dce6b33cee2;p=thirdparty%2Fdhcpcd.git Avoid printing the leasefile on error with a valid interface. --- diff --git a/dhcp.c b/dhcp.c index 99ccda15..93812bc1 100644 --- a/dhcp.c +++ b/dhcp.c @@ -2940,8 +2940,8 @@ dhcp_dump(struct interface *ifp) AF_INET, ifp, ""); state->new = read_lease(ifp); if (state->new == NULL) { - logger(ifp->ctx, LOG_ERR, - "%s: %s: %m", state->leasefile, __func__); + logger(ifp->ctx, LOG_ERR, "%s: %s: %m", + *ifp->name ? ifp->name : state->leasefile, __func__); return -1; } state->reason = "DUMP"; diff --git a/dhcp6.c b/dhcp6.c index 476e2657..24b808cb 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -3584,8 +3584,8 @@ dhcp6_dump(struct interface *ifp) AF_INET6, ifp, ifp->options->options & DHCPCD_PFXDLGONLY ? ".pd" : ""); if (dhcp6_readlease(ifp, 0) == -1) { - logger(ifp->ctx, LOG_ERR, - "%s: %s: %m", state->leasefile, __func__); + logger(ifp->ctx, LOG_ERR, "%s: %s: %m", + *ifp->name ? ifp->name : state->leasefile, __func__); return -1; } state->reason = "DUMP6";