summaryrefslogtreecommitdiff
path: root/src/ra.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-02-02 18:40:50 +0100
committerSteven Barth <steven@midlink.org>2014-02-02 18:40:50 +0100
commit9817e4983c7d4e28f53b78d4fc6ea1eabed8affe (patch)
tree3f2b1380a11a2dc1ee32ed1b6f14401e1c820ebe /src/ra.c
parentb4a0f3d74b04074eae21e88fbf5b8f2ddc150f86 (diff)
downloadodhcp6c-9817e4983c7d4e28f53b78d4fc6ea1eabed8affe.tar.gz
RA: fix on-link/off-link handling
Diffstat (limited to 'src/ra.c')
-rw-r--r--src/ra.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ra.c b/src/ra.c
index 560552f..6132e45 100644
--- a/src/ra.c
+++ b/src/ra.c
@@ -356,16 +356,18 @@ bool ra_process(void)
|| 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;