When dropping, move the new config onto the old before running the script.

This commit is contained in:
Roy Marples 2014-05-06 14:39:31 +00:00
parent 26ede0ceb8
commit 8d442d9eac

View File

@ -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;
}