mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
When advertising ONLY deleted IPv6 prefixes, set router lifetime to zero.
This commit is contained in:
11
src/radv.c
11
src/radv.c
@@ -205,7 +205,7 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de
|
||||
struct dhcp_netid iface_id;
|
||||
struct dhcp_opt *opt_cfg;
|
||||
struct ra_interface *ra_param = find_iface_param(iface_name);
|
||||
int done_dns = 0;
|
||||
int done_dns = 0, old_prefix = 0;
|
||||
#ifdef HAVE_LINUX_NETWORK
|
||||
FILE *f;
|
||||
#endif
|
||||
@@ -267,7 +267,7 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de
|
||||
struct in6_addr local = context->start6;
|
||||
int do_slaac = 0;
|
||||
|
||||
parm.found_context = 1;
|
||||
old_prefix = 1;
|
||||
|
||||
/* zero net part of address */
|
||||
setaddr6part(&local, addr6part(&local) & ~((context->prefix == 64) ? (u64)-1LL : (1LLU << (128 - context->prefix)) - 1LLU));
|
||||
@@ -300,7 +300,12 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de
|
||||
up = &context->next;
|
||||
}
|
||||
|
||||
if (!parm.found_context)
|
||||
/* If we're advertising only old prefixes, set router lifetime to zero. */
|
||||
if (old_prefix && !parm.found_context)
|
||||
ra->lifetime = htons(0);
|
||||
|
||||
/* No prefixes to advertise. */
|
||||
if (!old_prefix && !parm.found_context)
|
||||
return;
|
||||
|
||||
#ifdef HAVE_LINUX_NETWORK
|
||||
|
||||
Reference in New Issue
Block a user