]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix removing old config.
authorRoy Marples <roy@marples.name>
Thu, 11 Sep 2008 15:50:19 +0000 (15:50 +0000)
committerRoy Marples <roy@marples.name>
Thu, 11 Sep 2008 15:50:19 +0000 (15:50 +0000)
dhcpcd.c

index d7111117cd54178b6451c723eb0041ff2c475133..0eb61cf555057309371e17121fa4a94eb3e2fad3 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -180,11 +180,10 @@ void
 drop_config(struct interface *iface, const char *reason)
 {
        if (iface->state->new || strcmp(reason, "FAIL") == 0) {
-               free(iface->state->new);
+               free(iface->state->old);
+               iface->state->old = iface->state->new;
                iface->state->new = NULL;
                configure(iface, reason);
-               free(iface->state->old);
-               iface->state->old = NULL;
        }
        iface->state->lease.addr.s_addr = 0;
 }