]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
When dropping, move the new config onto the old before running the script.
authorRoy Marples <roy@marples.name>
Tue, 6 May 2014 14:39:31 +0000 (14:39 +0000)
committerRoy Marples <roy@marples.name>
Tue, 6 May 2014 14:39:31 +0000 (14:39 +0000)
dhcp6.c

diff --git a/dhcp6.c b/dhcp6.c
index 8a25dd93d1ce8acde6c9849270149878deddb049..8c27bcc47e65d7fa17b29d14aaedaf37ca69f107 100644 (file)
--- 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;
        }