From: Roy Marples Date: Fri, 12 Jun 2015 20:23:28 +0000 (+0000) Subject: Add the DHCPCD_NODROP macro to simplify if we drop addresses or not. X-Git-Tag: v6.9.1~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=389a250b2f84828d0668a93ec24f4b4138791829;p=thirdparty%2Fdhcpcd.git Add the DHCPCD_NODROP macro to simplify if we drop addresses or not. --- diff --git a/dhcp6.c b/dhcp6.c index d551cc79..19f7446b 100644 --- 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"; diff --git a/if-options.h b/if-options.h index d5ff7a2e..658440d9 100644 --- a/if-options.h +++ b/if-options.h @@ -113,9 +113,11 @@ #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[]; diff --git a/ipv6nd.c b/ipv6nd.c index fe368dbd..34960eb2 100644 --- 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"); } }