From 378fa56888767ff58762a338c3425647b98bf59e Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Sun, 5 Jan 2020 17:23:19 +0000 Subject: [PATCH] Don't send RAs on interfaces without a link-local address. Since the source address of the RAs must be the link-local address. --- src/radv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/radv.c b/src/radv.c index cd5853a..cad0530 100644 --- a/src/radv.c +++ b/src/radv.c @@ -288,7 +288,10 @@ static void send_ra_alias(time_t now, int iface, char *iface_name, struct in6_ad context->netid.next = &context->netid; } - if (!iface_enumerate(AF_INET6, &parm, add_prefixes)) + /* If no link-local address then we can't advertise since source address of + advertisement must be link local address: RFC 4861 para 6.1.2. */ + if (!iface_enumerate(AF_INET6, &parm, add_prefixes) || + parm.link_pref_time == 0) return; /* Find smallest preferred time within address classes,