diff --git a/src/radv.c b/src/radv.c index f01b136..9fd56ab 100644 --- a/src/radv.c +++ b/src/radv.c @@ -272,10 +272,28 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de /* zero net part of address */ setaddr6part(&local, addr6part(&local) & ~((context->prefix == 64) ? (u64)-1LL : (1LLU << (128 - context->prefix)) - 1LLU)); + if ((context->flags & (CONTEXT_RA_ONLY | CONTEXT_RA_NAME | CONTEXT_RA_STATELESS))) - do_slaac = 1; - + { + do_slaac = 1; + if (context->flags & CONTEXT_DHCP) + { + parm.other = 1; + if (!(context->flags & CONTEXT_RA_STATELESS)) + parm.managed = 1; + } + } + else + { + /* don't do RA for non-ra-only unless --enable-ra is set */ + if (option_bool(OPT_RA)) + { + parm.managed = 1; + parm.other = 1; + } + } + if ((opt = expand(sizeof(struct prefix_opt)))) { opt->type = ICMP6_OPT_PREFIX;