summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-11-07 18:57:35 +0000
committerRoy Marples <roy@marples.name>2014-11-07 18:57:35 +0000
commitf29061fe964033f926694b5f3a2adf406029d962 (patch)
tree4d2fb27f1b3e4bf1a1d2cd4ca77bda2dd8616b76 /dhcpcd.c
parent81eb28381f459f9facfd04a10330e8e516463eb4 (diff)
downloaddhcpcd-f29061fe964033f926694b5f3a2adf406029d962.tar.xz
When stopping interfaces, skip past pseudo interfaces instead of finding
the master as only the masters are sorted correctly.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index 22da5ab5..2587dd7c 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -970,18 +970,18 @@ reconf_reboot(struct dhcpcd_ctx *ctx, int action, int argc, char **argv, int oi)
static void
stop_all_interfaces(struct dhcpcd_ctx *ctx, int do_release)
{
- struct interface *ifp, *ifpm;
+ struct interface *ifp;
/* drop_dhcp could change the order, so we do it like this. */
for (;;) {
- /* Be sane and drop the last config first */
- ifp = TAILQ_LAST(ctx->ifaces, if_head);
+ /* Be sane and drop the last config first,
+ * skipping any pseudo interfaces */
+ TAILQ_FOREACH_REVERSE(ifp, ctx->ifaces, if_head, next) {
+ if (!(ifp->options->options & DHCPCD_PFXDLGONLY))
+ break;
+ }
if (ifp == NULL)
break;
- /* Stop the master interface only */
- ifpm = if_find(ifp->ctx, ifp->name);
- if (ifpm)
- ifp = ifpm;
if (do_release) {
ifp->options->options |= DHCPCD_RELEASE;
ifp->options->options &= ~DHCPCD_PERSISTENT;