]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Add the DHCPCD_NODROP macro to simplify if we drop addresses or not.
authorRoy Marples <roy@marples.name>
Fri, 12 Jun 2015 20:23:28 +0000 (20:23 +0000)
committerRoy Marples <roy@marples.name>
Fri, 12 Jun 2015 20:23:28 +0000 (20:23 +0000)
dhcp6.c
if-options.h
ipv6nd.c

diff --git a/dhcp6.c b/dhcp6.c
index d551cc79b8501cd3ca9cbe6f1eed73ac81ac8d97..19f7446ba0158244a9d3b8f001e94d2d7c06bd49 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -3252,9 +3252,7 @@ dhcp6_freedrop(struct interface *ifp, int drop, const char *reason)
        else
                options = 0;
        dropdele = (options & (DHCPCD_STOPPING | DHCPCD_RELEASE) &&
-           (options &
-           (DHCPCD_EXITING | DHCPCD_PERSISTENT)) !=
-           (DHCPCD_EXITING | DHCPCD_PERSISTENT));
+           (options & DHCPCD_NODROP) != DHCPCD_NODROP);
 
        if (ifp->ctx->eloop)
                eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
@@ -3277,9 +3275,7 @@ dhcp6_freedrop(struct interface *ifp, int drop, const char *reason)
                state->new = NULL;
                state->new_len = 0;
                if (drop && state->old &&
-                   (options &
-                   (DHCPCD_EXITING | DHCPCD_PERSISTENT)) !=
-                   (DHCPCD_EXITING | DHCPCD_PERSISTENT))
+                   (options & DHCPCD_NODROP) != DHCPCD_NODROP)
                {
                        if (reason == NULL)
                                reason = "STOP6";
index d5ff7a2e3cd79c2a686d662a719809d37e0abb33..658440d9cbd74b6ca51c88cd3f94f6a75283bb8d 100644 (file)
 #define DHCPCD_BOOTP                   (1ULL << 57)
 #define DHCPCD_INITIAL_DELAY           (1ULL << 58)
 
-#define DHCPCD_WAITOPTS (DHCPCD_WAITIP | DHCPCD_WAITIP4 | DHCPCD_WAITIP6)
+#define DHCPCD_NODROP  (DHCPCD_EXITING | DHCPCD_PERSISTENT)
 
-#define DHCPCD_WARNINGS (DHCPCD_CSR_WARNED | \
+#define DHCPCD_WAITOPTS        (DHCPCD_WAITIP | DHCPCD_WAITIP4 | DHCPCD_WAITIP6)
+
+#define DHCPCD_WARNINGS        (DHCPCD_CSR_WARNED | \
                DHCPCD_ROUTER_HOST_ROUTE_WARNED)
 
 extern const struct option cf_options[];
index fe368dbd037e63400ee4ba960d2c1c154d19af63..34960eb22095436e196dd2a1216161b8c428ee63 100644 (file)
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -1483,9 +1483,7 @@ ipv6nd_drop(struct interface *ifp)
                        ipv6nd_drop_ra(rap);
                }
                ipv6_buildroutes(ifp->ctx);
-               if ((ifp->options->options &
-                   (DHCPCD_EXITING | DHCPCD_PERSISTENT)) !=
-                   (DHCPCD_EXITING | DHCPCD_PERSISTENT))
+               if ((ifp->options->options & DHCPCD_NODROP) != DHCPCD_NODROP)
                        script_runreason(ifp, "ROUTERADVERT");
        }
 }