a = malloc(sizeof(*a));
if (a) {
a->new = 1;
+ a->onlink = 1; /* XXX: suprised no DHCP opt for this */
p = D6_COPTION_DATA(o);
memcpy(&a->addr.s6_addr, p,
sizeof(a->addr.s6_addr));
#endif
{
r = del_route6(rt);
- /* If the subnet route didn't exist, don't
- * moan about it.
- * We currently do this to silence FreeBSD-7 */
if (r == -1 && errno == ESRCH)
r = 0;
}
d6_state = D6_CSTATE(ifp);
if (d6_state && d6_state->state == DH6S_BOUND) {
TAILQ_FOREACH(addr, &d6_state->addrs, next) {
+ if (!addr->onlink)
+ continue;
rt = make_prefix(ifp, NULL, addr);
if (rt)
TAILQ_INSERT_TAIL(&dnr, rt, next);
TAILQ_FOREACH(rap, &ipv6_routers, next) {
if (options & DHCPCD_IPV6RA_OWN) {
TAILQ_FOREACH(addr, &rap->addrs, next) {
+ if (!addr->onlink)
+ continue;
rt = make_prefix(rap->iface, rap, addr);
if (rt)
TAILQ_INSERT_TAIL(&dnr, rt, next);
uint32_t prefix_vltime;
uint32_t prefix_pltime;
struct in6_addr addr;
- int new;
+ uint8_t onlink;
+ uint8_t new;
char saddr[INET6_ADDRSTRLEN];
};
TAILQ_HEAD(ipv6_addrhead, ipv6_addr);
* This is safe because the RA is removed from the list
* before we are called. */
if (drop && (options & DHCPCD_IPV6RA_OWN) &&
+ !IN6_IS_ADDR_UNSPECIFIED(&ap->addr) &&
!ipv6rs_addrexists(ap) && !dhcp6_addrexists(ap))
{
syslog(LOG_INFO, "%s: deleting address %s",
sizeof(ap->prefix.s6_addr)) == 0)
break;
if (ap == NULL) {
+ if (!(pi->nd_opt_pi_flags_reserved &
+ ND_OPT_PI_FLAG_AUTO) &&
+ !(pi->nd_opt_pi_flags_reserved &
+ ND_OPT_PI_FLAG_ONLINK))
+ break;
ap = xmalloc(sizeof(*ap));
ap->new = 1;
ap->prefix_len = pi->nd_opt_pi_prefix_len;
ap->new = 1;
else
ap->new = 0;
+ if (pi->nd_opt_pi_flags_reserved &
+ ND_OPT_PI_FLAG_ONLINK)
+ ap->onlink = 1;
ap->prefix_vltime =
ntohl(pi->nd_opt_pi_valid_time);
ap->prefix_pltime =