]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Only read the DHCP lease when doing DHCP.
authorRoy Marples <roy@marples.name>
Fri, 24 Jul 2015 21:51:02 +0000 (21:51 +0000)
committerRoy Marples <roy@marples.name>
Fri, 24 Jul 2015 21:51:02 +0000 (21:51 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index a413956a8eab83de9c8c38c5dd9799fede61acfc..fbc5778e1b2dd02d588e5a23eacda2f67451c2a1 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -3200,7 +3200,7 @@ dhcp_start1(void *arg)
        }
        /* We don't want to read the old lease if we NAK an old test */
        nolease = state->offer && ifp->ctx->options & DHCPCD_TEST;
-       if (!nolease) {
+       if (!nolease && ifo->options & DHCPCD_DHCP) {
                state->offer = read_lease(ifp);
                /* Check the saved lease matches the type we want */
                if (state->offer) {