From: Roy Marples Date: Wed, 20 Nov 2013 11:37:25 +0000 (+0000) Subject: When releasing, we need to de-configure the interface as well. X-Git-Tag: v6.2.0~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4873594f06ca952eeedb1e52acdf3b5afbffb9e2;p=thirdparty%2Fdhcpcd.git When releasing, we need to de-configure the interface as well. --- diff --git a/dhcpcd.c b/dhcpcd.c index 6e5bc03b..6ea8f1de 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -325,6 +325,11 @@ configure_interface1(struct interface *ifp) /* Do any platform specific configuration */ if_conf(ifp); + /* If we want to release a lease, we can't really persist the + * address either. */ + if (ifo->options & DHCPCD_RELEASE) + ifo->options &= ~DHCPCD_PERSISTENT; + if (ifp->flags & IFF_POINTOPOINT && !(ifo->options & DHCPCD_INFORM)) ifo->options |= DHCPCD_STATIC; if (ifp->flags & IFF_NOARP || @@ -889,8 +894,10 @@ handle_signal(int sig, siginfo_t *siginfo, __unused void *context) ifp = TAILQ_LAST(ifaces, if_head); if (ifp == NULL) break; - if (do_release) + if (do_release) { ifp->options->options |= DHCPCD_RELEASE; + ifp->options->options &= ~DHCPCD_PERSISTENT; + } ifp->options->options |= DHCPCD_EXITING; stop_interface(ifp); } @@ -1027,8 +1034,10 @@ handle_args(struct fd_list *fd, int argc, char **argv) for (oi = optind; oi < argc; oi++) { if ((ifp = find_interface(argv[oi])) == NULL) continue; - if (do_release) + if (do_release) { ifp->options->options |= DHCPCD_RELEASE; + ifp->options->options &= ~DHCPCD_PERSISTENT; + } ifp->options->options |= DHCPCD_EXITING; stop_interface(ifp); }