From: Roy Marples Date: Fri, 28 Nov 2014 15:18:09 +0000 (+0000) Subject: If STOPPED, set if_down = true when releasing, otherwise false. X-Git-Tag: v6.6.5~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25f760b563bbda54ab977eb6fc1aa51805ec383e;p=thirdparty%2Fdhcpcd.git If STOPPED, set if_down = true when releasing, otherwise false. Let dhcpcd-run-hooks process STOPPED. --- diff --git a/dhcpcd-run-hooks.in b/dhcpcd-run-hooks.in index f1f77a86..fd001d4a 100644 --- a/dhcpcd-run-hooks.in +++ b/dhcpcd-run-hooks.in @@ -7,8 +7,6 @@ case "$reason" in ifsuffix=":ra";; INFORM6|BOUND6|RENEW6|REBIND6|REBOOT6|EXPIRE6|RELEASE6|STOP6) ifsuffix=":dhcp6";; - STOPPED) # This reason should never be processed - exit 0;; *) ifsuffix=;; esac diff --git a/script.c b/script.c index 31e80fab..9f25d166 100644 --- a/script.c +++ b/script.c @@ -335,7 +335,13 @@ make_env(const struct interface *ifp, const char *reason, char ***argv) } } *--p = '\0'; - if (strcmp(reason, "TEST") == 0 || + if (strcmp(reason, "STOPPED") == 0) { + env[9] = strdup("if_up=false"); + if (ifo->options & DHCPCD_RELEASE) + env[9] = strdup("if_down=true"); + else + env[9] = strdup("if_down=false"); + } else if (strcmp(reason, "TEST") == 0 || strcmp(reason, "PREINIT") == 0 || strcmp(reason, "CARRIER") == 0 || strcmp(reason, "UNKNOWN") == 0)