#endif
-#ifdef KERNEL_MANAGETEMPADDR
-#define ipv6_regentempifid(a) {}
-#else
+#ifdef IPV6_MANAGETEMPADDR
static void ipv6_regentempifid(void *);
static void ipv6_regentempaddr(void *);
+#else
+#define ipv6_regentempifid(a) {}
#endif
struct ipv6_ctx *
return -1;
}
-#ifndef KERNEL_MANAGETEMPADDR
+#ifdef IPV6_MANAGETEMPADDR
/* RFC4941 Section 3.4 */
if (ap->flags & IPV6_AF_TEMPORARY &&
ap->prefix_pltime &&
return alldadcompleted ? found : 0;
}
-#ifndef KERNEL_MANAGETEMPADDR
+#ifdef IPV6_MANAGETEMPADDR
static const struct ipv6_addr *
ipv6_findaddrid(struct dhcpcd_ctx *ctx, uint8_t *addr)
{
ipv6_regen_desync(ifp, 1);
}
-#endif /* !KERNEL_MANAGETEMPADDR */
+#endif /* IPV6_MANAGETEMPADDR */
static struct rt6 *
find_route6(struct rt6_head *rts, const struct rt6 *r)
/* Linux-3.18 can manage temporary addresses even with RA
* processing disabled. */
-//#undef IFA_F_MANAGETEMPADDR
-#ifdef IFA_F_MANAGETEMPADDR
-#define KERNEL_MANAGETEMPADDR
+#undef IFA_F_MANAGETEMPADDR
+#ifndef IFA_F_MANAGETEMPADDR
+#define IPV6_MANAGETEMPADDR
#endif
struct ipv6_addr {
struct ipv6_addrhead addrs;
struct ll_callback_head ll_callbacks;
+#ifdef IPV6_MANAGETEMPADDR
time_t desync_factor;
uint8_t randomseed0[8]; /* upper 64 bits of MD5 digest */
uint8_t randomseed1[8]; /* lower 64 bits */
uint8_t randomid[8];
+#endif
};
#define IPV6_STATE(ifp) \
int ipv6_addlinklocalcallback(struct interface *, void (*)(void *), void *);
void ipv6_drop(struct interface *);
-#ifdef KERNEL_MANAGETEMPADDR
-#define ipv6_gentempifid(a) {}
-#define ipv6_settempstale(a) {}
-#define ipv6_createtempaddr(a, b) (NULL)
-#define ipv6_settemptime(a, b) (NULL)
-#define ipv6_addtempaddrs(a, b) {}
-#else
+#ifdef IPV6_MANAGETEMPADDR
void ipv6_gentempifid(struct interface *);
void ipv6_settempstale(struct interface *);
struct ipv6_addr *ipv6_createtempaddr(struct ipv6_addr *,
const struct timeval *);
struct ipv6_addr *ipv6_settemptime(struct ipv6_addr *, int);
void ipv6_addtempaddrs(struct interface *, const struct timeval *);
+#else
+#define ipv6_gentempifid(a) {}
+#define ipv6_settempstale(a) {}
#endif
int ipv6_start(struct interface *);
struct ipv6_addr *ap;
char *opt, *opt2, *tmp;
struct timeval expire;
- uint8_t new_rap, new_data, new_ap;
+ uint8_t new_rap, new_data;
+#ifdef IPV6_MANAGETEMPADDR
+ uint8_t new_ap;
+#endif
if (len < sizeof(struct nd_router_advert)) {
syslog(LOG_ERR, "IPv6 RA packet too short from %s", ctx->sfrom);
ap->created = ap->acquired = rap->received;
TAILQ_INSERT_TAIL(&rap->addrs, ap, next);
+#ifdef IPV6_MANAGETEMPADDR
/* New address to dhcpcd RA handling.
* If the address already exists and a valid
* temporary address also exists then
new_ap = 0;
else
new_ap = 1;
+#endif
} else {
+#ifdef IPV6_MANAGETEMPADDR
new_ap = 0;
+#endif
ap->flags &= ~IPV6_AF_STALE;
ap->acquired = rap->received;
}
}
}
+#ifdef IPV6_MANAGETEMPADDR
/* RFC4941 Section 3.3.3 */
if (ap->flags & IPV6_AF_AUTOCONF &&
ap->iface->options->options & DHCPCD_IPV6RA_OWN &&
"ipv6_createtempaddr: %m");
}
}
+#endif
lifetime = ap->prefix_vltime;
break;
goto handle_flag;
}
ipv6_addaddrs(&rap->addrs);
+#ifdef IPV6_MANAGETEMPADDR
ipv6_addtempaddrs(ifp, &rap->received);
+#endif
ipv6_buildroutes(ifp->ctx);
if (ipv6nd_scriptrun(rap))
return;