diff options
author | Simon Kelley <simon@thekelleys.org.uk> | 2013-12-19 15:45:12 +0000 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2013-12-19 15:45:12 +0000 |
commit | 6ea1f23b3fca47493a93a1a890805054d19a7124 (patch) | |
tree | e5885292ad6a4c17ad23da7aaff761d8c5322760 /src/radv.c | |
parent | 00238fb019988c6e35e1dd411c0118bf56d18d25 (diff) | |
download | dnsmasq-6ea1f23b3fca47493a93a1a890805054d19a7124.tar.gz |
Send correct O and M bits when advertising only deprecated prefixes.
Diffstat (limited to 'src/radv.c')
-rw-r--r-- | src/radv.c | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -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; |