This is easier to see the difference with IPV6_AF_DELEGAGTED.
state->failed = true;
if (drop) {
- dhcp6_freedrop_addrs(ifp, 1, IPV6_AF_ANYDELEGATED, NULL);
+ dhcp6_freedrop_addrs(ifp, 1,
+ IPV6_AF_DELEGATED | IPV6_AF_PFXDELEGATION, NULL);
#ifndef SMALL
dhcp6_delete_delegates(ifp);
#endif
if (a == NULL) {
a = ipv6_newaddr(ifp, &pdp_prefix, pdp_plen,
- IPV6_AF_DELEGATEDPFX);
+ IPV6_AF_PFXDELEGATION);
if (a == NULL)
break;
a->created = *acquired;
memcpy(a->iaid, iaid, sizeof(a->iaid));
TAILQ_INSERT_TAIL(&state->addrs, a, next);
} else {
- if (!(a->flags & IPV6_AF_DELEGATEDPFX))
- a->flags |= IPV6_AF_NEW | IPV6_AF_DELEGATEDPFX;
+ if (!(a->flags & IPV6_AF_PFXDELEGATION))
+ a->flags |= IPV6_AF_NEW | IPV6_AF_PFXDELEGATION;
a->flags &= ~(IPV6_AF_STALE | IPV6_AF_EXTENDED);
if (a->prefix_vltime != pdp_vltime)
a->flags |= IPV6_AF_NEW;
#ifndef SMALL
/* If we delegated from this prefix, deprecate or remove
* the delegations. */
- if (ia->flags & IPV6_AF_DELEGATEDPFX)
+ if (ia->flags & IPV6_AF_PFXDELEGATION)
dhcp6_deprecatedele(ia);
#endif
k = 0;
carrier_warned = false;
TAILQ_FOREACH(ap, &state->addrs, next) {
- if (!(ap->flags & IPV6_AF_DELEGATEDPFX))
+ if (!(ap->flags & IPV6_AF_PFXDELEGATION))
continue;
if (!(ap->flags & IPV6_AF_DELEGATEDLOG)) {
int loglevel;
if (state == NULL || state->state != DH6S_BOUND)
continue;
TAILQ_FOREACH(ap, &state->addrs, next) {
- if (!(ap->flags & IPV6_AF_DELEGATEDPFX))
+ if (!(ap->flags & IPV6_AF_PFXDELEGATION))
continue;
for (i = 0; i < ifo->ia_len; i++) {
ia = &ifo->ia[i];
{
/* A delegated prefix is not an address. */
- if (ia->flags & IPV6_AF_DELEGATEDPFX)
+ if (ia->flags & IPV6_AF_PFXDELEGATION)
return 0;
if (ia->prefix_vltime == 0) {
struct ipv6_addr *iad;
/* Forget the reference */
- if (ia->flags & IPV6_AF_DELEGATEDPFX) {
+ if (ia->flags & IPV6_AF_PFXDELEGATION) {
TAILQ_FOREACH(iad, &ia->pd_pfxs, pd_next) {
iad->delegating_prefix = NULL;
}
#else
return ia;
#endif
- } else if (ia->flags & (IPV6_AF_REQUEST | IPV6_AF_DELEGATEDPFX)) {
+ } else if (ia->flags & (IPV6_AF_REQUEST | IPV6_AF_PFXDELEGATION)) {
ia->prefix = *addr;
cbp = inet_ntop(AF_INET6, &ia->prefix, buf, sizeof(buf));
goto paddr;
/* This address is the delegated prefix, so add a reject route for
* it via the loopback interface. */
- if (addr->flags & IPV6_AF_DELEGATEDPFX) {
+ if (addr->flags & IPV6_AF_PFXDELEGATION) {
struct interface *lo0;
TAILQ_FOREACH(lo0, ifp->ctx->ifaces, next) {
sa_in6_init(&rt->rt_dest, &addr->prefix);
ipv6_mask(&netmask, addr->prefix_len);
sa_in6_init(&rt->rt_netmask, &netmask);
- if (addr->flags & IPV6_AF_DELEGATEDPFX) {
+ if (addr->flags & IPV6_AF_PFXDELEGATION) {
rt->rt_flags |= RTF_REJECT;
/* Linux does not like a gateway for a reject route. */
#ifndef __linux__
TAILQ_FOREACH(ia, &d6_state->addrs, next) {
if (dstate == DH6S_DELEGATED) {
// Reject route won't have IPV6_AF_ADDED
- if (!(ia->flags & IPV6_AF_DELEGATEDPFX))
+ if (!(ia->flags & IPV6_AF_PFXDELEGATION))
continue;
} else if (!(ia->flags & IPV6_AF_ADDED))
continue;
#define IPV6_AF_ADDED (1U << 3)
#define IPV6_AF_AUTOCONF (1U << 4)
#define IPV6_AF_DADCOMPLETED (1U << 5)
-#define IPV6_AF_DELEGATED (1U << 6) // Delegated from prefix
-#define IPV6_AF_DELEGATEDPFX (1U << 7) // Delegated prefix
+#define IPV6_AF_PFXDELEGATION (1U << 6)
+#define IPV6_AF_DELEGATED (1U << 7)
#define IPV6_AF_NOREJECT (1U << 8)
#define IPV6_AF_REQUEST (1U << 9)
#define IPV6_AF_STATIC (1U << 10)
#define IPV6_AF_TEMPORARY (1U << 16)
#endif
-#define IPV6_AF_ANYDELEGATED (IPV6_AF_DELEGATED | IPV6_AF_DELEGATEDPFX)
-
struct ll_callback {
TAILQ_ENTRY(ll_callback) next;
void (*callback)(void *);