From: Roy Marples Date: Tue, 6 May 2014 14:39:31 +0000 (+0000) Subject: When dropping, move the new config onto the old before running the script. X-Git-Tag: v6.4.0~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d442d9eac1052f829819235d9bf7f4ddb533c17;p=thirdparty%2Fdhcpcd.git When dropping, move the new config onto the old before running the script. --- diff --git a/dhcp6.c b/dhcp6.c index 8a25dd93..8c27bcc4 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -2710,7 +2710,10 @@ dhcp6_freedrop(struct interface *ifp, int drop, const char *reason) unlink(state->leasefile); } dhcp6_freedrop_addrs(ifp, drop, NULL); - if (drop && state->new && + free(state->old); + state->old = state->new; + state->new = NULL; + if (drop && state->old && (options & (DHCPCD_EXITING | DHCPCD_PERSISTENT)) != (DHCPCD_EXITING | DHCPCD_PERSISTENT)) @@ -2719,10 +2722,9 @@ dhcp6_freedrop(struct interface *ifp, int drop, const char *reason) reason = "STOP6"; script_runreason(ifp, reason); } + free(state->old); free(state->send); free(state->recv); - free(state->new); - free(state->old); free(state); ifp->if_data[IF_DATA_DHCP6] = NULL; }