summaryrefslogtreecommitdiff
path: root/src/radv.c
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2013-10-14 14:08:44 +0100
committerSimon Kelley <simon@thekelleys.org.uk>2013-10-14 14:08:44 +0100
commit806cf78797bfe912a4912fd035d4f5eeb3d46718 (patch)
treedf4dd49e23ba258d782014df8158d4e243d86c54 /src/radv.c
parent3b3f441189d070127f5c5176d24009fc0d178bc5 (diff)
downloaddnsmasq-806cf78797bfe912a4912fd035d4f5eeb3d46718.tar.gz
Better defaults for address and lifetime of RDNS option in RA.
Diffstat (limited to 'src/radv.c')
-rw-r--r--src/radv.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/radv.c b/src/radv.c
index 8e0a730..88395db 100644
--- a/src/radv.c
+++ b/src/radv.c
@@ -336,15 +336,15 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de
if (opt_cfg->opt == OPTION6_DNS_SERVER)
{
struct in6_addr *a = (struct in6_addr *)opt_cfg->val;
-
+
done_dns = 1;
- if (opt_cfg->len == 0)
- continue;
+ if (opt_cfg->len == 0 || (IN6_IS_ADDR_UNSPECIFIED(a) && parm.pref_time != 0))
+ continue;
put_opt6_char(ICMP6_OPT_RDNSS);
put_opt6_char((opt_cfg->len/8) + 1);
put_opt6_short(0);
- put_opt6_long(parm.adv_interval * 2); /* lifetime - twice RA retransmit */
+ put_opt6_long(parm.pref_time);
/* zero means "self" */
for (i = 0; i < opt_cfg->len; i += IN6ADDRSZ, a++)
if (IN6_IS_ADDR_UNSPECIFIED(a))
@@ -360,7 +360,7 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de
put_opt6_char(ICMP6_OPT_DNSSL);
put_opt6_char(len + 1);
put_opt6_short(0);
- put_opt6_long(parm.adv_interval * 2); /* lifetime - twice RA retransmit */
+ put_opt6_long(parm.pref_time);
put_opt6(opt_cfg->val, opt_cfg->len);
/* pad */
@@ -369,14 +369,14 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de
}
}
- if (daemon->port == NAMESERVER_PORT && !done_dns)
+ if (daemon->port == NAMESERVER_PORT && !done_dns && parm.pref_time != 0)
{
/* default == us, as long as we are supplying DNS service. */
put_opt6_char(ICMP6_OPT_RDNSS);
put_opt6_char(3);
put_opt6_short(0);
- put_opt6_long(parm.adv_interval * 2); /* lifetime - twice RA retransmit */
- put_opt6(&parm.link_global, IN6ADDRSZ);
+ put_opt6_long(parm.pref_time);
+ put_opt6(&parm.link_local, IN6ADDRSZ);
}
/* set managed bits unless we're providing only RA on this link */