[Dnsmasq-discuss] [PATCH] Don't advertise a default v6 route with no routeable prefixes
Chris Webb
chris at arachsys.com
Sat Jan 14 11:40:18 UTC 2023
When we are only advertising old v6 prefixes, we currently set the router
lifetime to zero in radv.c. This instructs automatically configured
clients not to configure a default v6 route pointing at us.
If we are advertising local (ULA) prefixes but no globally-routeable
prefixes, we should similarly not configure clients with a default route.
Set the router lifetime to zero in this case too.
Signed-off-by: Chris Webb <chris at arachsys.com>
---
src/radv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/radv.c b/src/radv.c
index 5820f4a..16737c4 100644
--- a/src/radv.c
+++ b/src/radv.c
@@ -402,8 +402,8 @@ static void send_ra_alias(time_t now, int iface, char *iface_name, struct in6_ad
up = &context->next;
}
- /* If we're advertising only old prefixes, set router lifetime to zero. */
- if (old_prefix && !parm.found_context)
+ /* If we're advertising only local or old prefixes, set router lifetime to zero. */
+ if ((old_prefix && !parm.found_context) || parm.glob_pref_time == 0)
ra->lifetime = htons(0);
/* No prefixes to advertise. */
More information about the Dnsmasq-discuss
mailing list