/**
- * Copyright (C) 2012-2013 Steven Barth <steven@midlink.org>
+ * Copyright (C) 2012-2014 Steven Barth <steven@midlink.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License v2 as published by
bool has_lladdr = !IN6_IS_ADDR_UNSPECIFIED(&lladdr);
uint8_t buf[1500], cmsg_buf[128];
struct nd_router_advert *adv = (struct nd_router_advert*)buf;
- struct odhcp6c_entry entry = {IN6ADDR_ANY_INIT, 0, 0, IN6ADDR_ANY_INIT, 0, 0, 0, 0, 0};
+ struct odhcp6c_entry entry = {IN6ADDR_ANY_INIT, 0, 0, IN6ADDR_ANY_INIT, 0, 0, 0, 0, 0, 0};
const struct in6_addr any = IN6ADDR_ANY_INIT;
if (!has_lladdr) {
|| entry.valid < entry.preferred)
continue;
- if (pinfo->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_ONLINK)
- changed |= odhcp6c_update_entry_safe(STATE_RA_ROUTE, &entry, 7200);
-
if (!(pinfo->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_AUTO) ||
- pinfo->nd_opt_pi_prefix_len != 64)
+ pinfo->nd_opt_pi_prefix_len != 64) {
+ if (pinfo->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_ONLINK)
+ changed |= odhcp6c_update_entry_safe(STATE_RA_ROUTE, &entry, 7200);
continue;
+ }
entry.target.s6_addr32[2] = lladdr.s6_addr32[2];
entry.target.s6_addr32[3] = lladdr.s6_addr32[3];
+ if (!(pinfo->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_ONLINK))
+ entry.length = 128;
changed |= odhcp6c_update_entry_safe(STATE_RA_PREFIX, &entry, 7200);
} else if (opt->type == ND_OPT_RECURSIVE_DNS && opt->len > 2) {
entry.router = from.sin6_addr;