]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Set interface is up when running IPV4LL scripts.
authorRoy Marples <roy@marples.name>
Mon, 29 Jun 2015 13:09:57 +0000 (13:09 +0000)
committerRoy Marples <roy@marples.name>
Mon, 29 Jun 2015 13:09:57 +0000 (13:09 +0000)
ipv4ll.h
script.c

index b2072844fe5faf46550f95e9a737a9397365b823..eeebb958ab7ce62ebb43049d02ca6d511a7afd68 100644 (file)
--- a/ipv4ll.h
+++ b/ipv4ll.h
@@ -50,6 +50,9 @@ struct ipv4ll_state {
        ((struct ipv4ll_state *)(ifp)->if_data[IF_DATA_IPV4LL])
 #define IPV4LL_CSTATE(ifp)                                                    \
        ((const struct ipv4ll_state *)(ifp)->if_data[IF_DATA_IPV4LL])
+#define IPV4LL_STATE_RUNNING(ifp)                                             \
+       (IPV4LL_CSTATE((ifp)) &&                                               \
+       IN_LINKLOCAL(ntohl(IPV4LL_CSTATE((ifp))->addr.s_addr)))
 
 struct rt* ipv4ll_subnet_route(const struct interface *);
 ssize_t ipv4ll_env(char **, const char *, const struct interface *);
index d152fb998288a595571c148362c5b62151379b38..9033e57509b29280c266e0cc770167f08abf5303 100644 (file)
--- a/script.c
+++ b/script.c
@@ -354,6 +354,7 @@ make_env(const struct interface *ifp, const char *reason, char ***argv)
        } else if (1 == 2 /* appease ifdefs */
 #ifdef INET
            || (dhcp && state && state->new)
+           || (ipv4ll && IPV4LL_STATE_RUNNING(ifp))
 #endif
 #ifdef INET6
            || (dhcp6 && d6_state && d6_state->new)