]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Avoid printing the leasefile on error with a valid interface.
authorRoy Marples <roy@marples.name>
Wed, 1 Apr 2015 22:53:00 +0000 (22:53 +0000)
committerRoy Marples <roy@marples.name>
Wed, 1 Apr 2015 22:53:00 +0000 (22:53 +0000)
dhcp.c
dhcp6.c

diff --git a/dhcp.c b/dhcp.c
index 99ccda1503b7d3da5ef286dec83e98f1d97f5639..93812bc1ff9e1b06f17d619f8d1f6f9f723cd5e0 100644 (file)
--- 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 476e26576f33ca3595f74a3dc662be5c3bc69976..24b808cb48a9b07bce3d041b3b57da223b718017 100644 (file)
--- 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";