[Dnsmasq-discuss] Infinite(?) RTR-ADVERTs being sent out [in Ubuntu NetworkManager testuite]
Iain Lane
laney at ubuntu.com
Mon Jan 7 12:51:14 GMT 2019
Hi there,
Back at the desk now. All I can do are naive things, so here's some of
those (inline):
On Fri, Dec 21, 2018 at 10:42:10PM +0000, Iain Lane wrote:
> Thanks Simon. I'm more or less offline for the holidays from now on, but
> I did test this and it didn't resolve the problem, I'm sorry to say.
>
> On Thu, Dec 20, 2018 at 11:36:46PM +0000, Simon Kelley wrote:
> > /* First time found, do fast RA. */
> > if (template->if_index != if_index ||
> > !IN6_ARE_ADDR_EQUAL(&template->local6, local))
I added some logging (inside the block, but *before* the new code to
update template->{if_index,local6}) to print out which condition was
failing to cause us to keep entering this loop. It's the second part
(!IN6_ARE_ADDR_EQUAL(...)). Short excerpt at the bottom¹.
Not sure if that output teaches you anything.
I looked at what ra_start_unsolicited() was doing, to see if I could add
an extra condition to prevent entering the branch multiple times for the
same context. This² works for the NetworkManager, but I don't know if
it's a sensible approach.
> > {
> > + template->if_index = if_index;
> > + template->local6 = *local;
> > ra_start_unsolicited(param->now, template);
> > param->newone = 1;
> > }
> > -
> > - template->if_index = if_index;
> > - template->local6 = *local;
(Don't you need to keep doing this for the pre-existing case? Done that in my ²
below.)
Thanks!
--
Iain Lane [ iain at orangesquash.org.uk ]
Debian Developer [ laney at debian.org ]
Ubuntu Developer [ laney at ubuntu.com ]
¹ Jan 7 11:58:40 dnsmasq-dhcp[2867]: RTR-ADVERT(veth42) 2600::
Jan 7 11:58:40 dnsmasq[2867]: Doing the bad thing: template->if_index != if_index? no, !IN6_ARE_ADDR_EQUAL(&template->local6, local)? yes (2600:0000:0000:0000:0000:0000:0000:0001 != 2600:0000:0000:0000:2c9a:36ff:fea9:bc93)
Jan 7 11:58:40 dnsmasq[2867]: Doing the bad thing: template->if_index != if_index? no, !IN6_ARE_ADDR_EQUAL(&template->local6, local)? yes (2600:0000:0000:0000:2c9a:36ff:fea9:bc93 != 2600:0000:0000:0000:0000:0000:0000:0001)
Jan 7 11:58:40 dnsmasq-dhcp[2867]: RTR-ADVERT(veth42) 2600::
Jan 7 11:58:40 dnsmasq[2867]: Doing the bad thing: template->if_index != if_index? no, !IN6_ARE_ADDR_EQUAL(&template->local6, local)? yes (2600:0000:0000:0000:0000:0000:0000:0001 != 2600:0000:0000:0000:2c9a:36ff:fea9:bc93)
Jan 7 11:58:40 dnsmasq[2867]: Doing the bad thing: template->if_index != if_index? no, !IN6_ARE_ADDR_EQUAL(&template->local6, local)? yes (2600:0000:0000:0000:2c9a:36ff:fea9:bc93 != 2600:0000:0000:0000:0000:0000:0000:0001)
Jan 7 11:58:40 dnsmasq-dhcp[2867]: RTR-ADVERT(veth42) 2600::
Jan 7 11:58:40 dnsmasq[2867]: Doing the bad thing: template->if_index != if_index? no, !IN6_ARE_ADDR_EQUAL(&template->local6, local)? yes (2600:0000:0000:0000:0000:0000:0000:0001 != 2600:0000:0000:0000:2c9a:36ff:fea9:bc93)
Jan 7 11:58:40 dnsmasq[2867]: Doing the bad thing: template->if_index != if_index? no, !IN6_ARE_ADDR_EQUAL(&template->local6, local)? yes (2600:0000:0000:0000:2c9a:36ff:fea9:bc93 != 2600:0000:0000:0000:0000:0000:0000:0001)
²
diff --git a/src/dhcp6.c b/src/dhcp6.c
index 56b2532..d8bbf28 100644
--- a/src/dhcp6.c
+++ b/src/dhcp6.c
@@ -655,14 +655,18 @@ static int construct_worker(struct in6_addr *local, int prefix,
is_same_net6(local, &template->end6, template->prefix))
{
/* First time found, do fast RA. */
- if (template->if_index != if_index || !IN6_ARE_ADDR_EQUAL(&template->local6, local))
+ if ((template->if_index != if_index || !IN6_ARE_ADDR_EQUAL(&template->local6, local)) && template->ra_short_period_start == 0)
{
+ template->if_index = if_index;
+ template->local6 = *local;
ra_start_unsolicited(param->now, template);
param->newone = 1;
}
-
- template->if_index = if_index;
- template->local6 = *local;
+ else
+ {
+ template->if_index = if_index;
+ template->local6 = *local;
+ }
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20190107/347096a1/attachment.sig>
More information about the Dnsmasq-discuss
mailing list