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                                  [ i...@orangesquash.org.uk ]
Debian Developer                                   [ la...@debian.org ]
Ubuntu Developer                                   [ la...@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;
+            }
          }
        
       }

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

Reply via email to