]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
More ap -> ia
authorRoy Marples <roy@marples.name>
Fri, 4 Aug 2017 18:59:03 +0000 (19:59 +0100)
committerRoy Marples <roy@marples.name>
Fri, 4 Aug 2017 18:59:03 +0000 (19:59 +0100)
src/dhcp6.c
src/ipv6.c
src/ipv6nd.c

index 7f75c351a368e1315f40162ede7cc1869e2f59c6..337b135acb455c5b46e75ec11f20e80fcf8ca535 100644 (file)
@@ -1340,34 +1340,34 @@ dhcp6_dadcompleted(const struct interface *ifp)
 static void
 dhcp6_dadcallback(void *arg)
 {
-       struct ipv6_addr *ap = arg;
+       struct ipv6_addr *ia = arg;
        struct interface *ifp;
        struct dhcp6_state *state;
        int wascompleted, valid;
 
-       wascompleted = (ap->flags & IPV6_AF_DADCOMPLETED);
-       ap->flags |= IPV6_AF_DADCOMPLETED;
-       if (ap->flags & IPV6_AF_DUPLICATED)
+       wascompleted = (ia->flags & IPV6_AF_DADCOMPLETED);
+       ia->flags |= IPV6_AF_DADCOMPLETED;
+       if (ia->flags & IPV6_AF_DUPLICATED)
                /* XXX FIXME
                 * We should decline the address */
-               logwarnx("%s: DAD detected %s", ap->iface->name, ap->saddr);
+               logwarnx("%s: DAD detected %s", ia->iface->name, ia->saddr);
 
        if (!wascompleted) {
-               ifp = ap->iface;
+               ifp = ia->iface;
                state = D6_STATE(ifp);
                if (state->state == DH6S_BOUND ||
                    state->state == DH6S_DELEGATED)
                {
-                       struct ipv6_addr *ap2;
+                       struct ipv6_addr *ia2;
 
 #ifdef SMALL
                        valid = true;
 #else
-                       valid = (ap->delegating_prefix == NULL);
+                       valid = (ia->delegating_prefix == NULL);
 #endif
-                       TAILQ_FOREACH(ap2, &state->addrs, next) {
-                               if (ap2->flags & IPV6_AF_ADDED &&
-                                   !(ap2->flags & IPV6_AF_DADCOMPLETED))
+                       TAILQ_FOREACH(ia2, &state->addrs, next) {
+                               if (ia2->flags & IPV6_AF_ADDED &&
+                                   !(ia2->flags & IPV6_AF_DADCOMPLETED))
                                {
                                        wascompleted = 1;
                                        break;
@@ -1378,7 +1378,7 @@ dhcp6_dadcallback(void *arg)
                                    ifp->name);
                                script_runreason(ifp,
 #ifndef SMALL
-                                   ap->delegating_prefix ? "DELEGATED6" :
+                                   ia->delegating_prefix ? "DELEGATED6" :
 #endif
                                    state->reason);
                                if (valid)
index e94a1253f8ca0d28d39321be1ffa63f4ceaa8168..61e5f23b5d6f85c9b1b24bdce7d58680e0ae2043 100644 (file)
@@ -955,23 +955,23 @@ ipv6_addaddrs(struct ipv6_addrhead *addrs)
 }
 
 void
-ipv6_freeaddr(struct ipv6_addr *ap)
+ipv6_freeaddr(struct ipv6_addr *ia)
 {
 #ifndef SMALL
-       struct ipv6_addr *ia;
+       struct ipv6_addr *iad;
 
        /* Forget the reference */
-       if (ap->flags & IPV6_AF_DELEGATEDPFX) {
-               TAILQ_FOREACH(ia, &ap->pd_pfxs, pd_next) {
-                       ia->delegating_prefix = NULL;
+       if (ia->flags & IPV6_AF_DELEGATEDPFX) {
+               TAILQ_FOREACH(iad, &ia->pd_pfxs, pd_next) {
+                       iad->delegating_prefix = NULL;
                }
-       } else if (ap->delegating_prefix != NULL) {
-               TAILQ_REMOVE(&ap->delegating_prefix->pd_pfxs, ap, pd_next);
+       } else if (ia->delegating_prefix != NULL) {
+               TAILQ_REMOVE(&ia->delegating_prefix->pd_pfxs, ia, pd_next);
        }
 #endif
 
-       eloop_q_timeout_delete(ap->iface->ctx->eloop, 0, NULL, ap);
-       free(ap);
+       eloop_q_timeout_delete(ia->iface->ctx->eloop, 0, NULL, ia);
+       free(ia);
 }
 
 void
index 15bd59991f74f4c26fd3a5b86a93abfed1c1f12f..cb683ca7073220f93a79faae3e152bd17c6820de 100644 (file)
@@ -618,7 +618,7 @@ ipv6nd_dadcompleted(const struct interface *ifp)
 static void
 ipv6nd_dadcallback(void *arg)
 {
-       struct ipv6_addr *ap = arg, *rapap;
+       struct ipv6_addr *ia = arg, *rapap;
        struct interface *ifp;
        struct ra *rap;
        int wascompleted, found;
@@ -627,54 +627,54 @@ ipv6nd_dadcallback(void *arg)
        const char *p;
        int dadcounter;
 
-       ifp = ap->iface;
-       wascompleted = (ap->flags & IPV6_AF_DADCOMPLETED);
-       ap->flags |= IPV6_AF_DADCOMPLETED;
-       if (ap->flags & IPV6_AF_DUPLICATED) {
-               ap->dadcounter++;
-               logwarnx("%s: DAD detected %s", ifp->name, ap->saddr);
+       ifp = ia->iface;
+       wascompleted = (ia->flags & IPV6_AF_DADCOMPLETED);
+       ia->flags |= IPV6_AF_DADCOMPLETED;
+       if (ia->flags & IPV6_AF_DUPLICATED) {
+               ia->dadcounter++;
+               logwarnx("%s: DAD detected %s", ifp->name, ia->saddr);
 
                /* Try and make another stable private address.
                 * Because ap->dadcounter is always increamented,
                 * a different address is generated. */
                /* XXX Cache DAD counter per prefix/id/ssid? */
                if (ifp->options->options & DHCPCD_SLAACPRIVATE) {
-                       if (ap->dadcounter >= IDGEN_RETRIES) {
+                       if (ia->dadcounter >= IDGEN_RETRIES) {
                                logerrx("%s: unable to obtain a"
                                    " stable private address",
                                    ifp->name);
                                goto try_script;
                        }
                        loginfox("%s: deleting address %s",
-                           ifp->name, ap->saddr);
-                       if (if_address6(RTM_DELADDR, ap) == -1 &&
+                           ifp->name, ia->saddr);
+                       if (if_address6(RTM_DELADDR, ia) == -1 &&
                            errno != EADDRNOTAVAIL && errno != ENXIO)
                                logerr(__func__);
-                       dadcounter = ap->dadcounter;
-                       if (ipv6_makestableprivate(&ap->addr,
-                           &ap->prefix, ap->prefix_len,
+                       dadcounter = ia->dadcounter;
+                       if (ipv6_makestableprivate(&ia->addr,
+                           &ia->prefix, ia->prefix_len,
                            ifp, &dadcounter) == -1)
                        {
                                logerr("ipv6_makestableprivate");
                                return;
                        }
-                       ap->dadcounter = dadcounter;
-                       ap->flags &= ~(IPV6_AF_ADDED | IPV6_AF_DADCOMPLETED);
-                       ap->flags |= IPV6_AF_NEW;
-                       p = inet_ntop(AF_INET6, &ap->addr, buf, sizeof(buf));
+                       ia->dadcounter = dadcounter;
+                       ia->flags &= ~(IPV6_AF_ADDED | IPV6_AF_DADCOMPLETED);
+                       ia->flags |= IPV6_AF_NEW;
+                       p = inet_ntop(AF_INET6, &ia->addr, buf, sizeof(buf));
                        if (p)
-                               snprintf(ap->saddr,
-                                   sizeof(ap->saddr),
+                               snprintf(ia->saddr,
+                                   sizeof(ia->saddr),
                                    "%s/%d",
-                                   p, ap->prefix_len);
+                                   p, ia->prefix_len);
                        else
-                               ap->saddr[0] = '\0';
+                               ia->saddr[0] = '\0';
                        tv.tv_sec = 0;
                        tv.tv_nsec = (suseconds_t)
                            arc4random_uniform(IDGEN_DELAY * NSEC_PER_SEC);
                        timespecnorm(&tv);
                        eloop_timeout_add_tv(ifp->ctx->eloop, &tv,
-                           ipv6nd_addaddr, ap);
+                           ipv6nd_addaddr, ia);
                        return;
                }
        }
@@ -694,7 +694,7 @@ try_script:
                                        wascompleted = 0;
                                        break;
                                }
-                               if (rapap == ap)
+                               if (rapap == ia)
                                        found = 1;
                        }