changeset 970:0c2a3672b356 draft

Fix removing old config.
author Roy Marples <roy@marples.name>
date Thu, 11 Sep 2008 15:50:19 +0000
parents f5c92b2d9e46
children 71c60fc4d1eb
files dhcpcd.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dhcpcd.c	Thu Sep 11 09:56:57 2008 +0000
+++ b/dhcpcd.c	Thu Sep 11 15:50:19 2008 +0000
@@ -180,11 +180,10 @@
 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;
 }