Anyone brave enough to OK this? I haven't heard from anyone that it
breaks their internet...

On Wed, Aug 01, 2018 at 11:18:02PM +0200, Florian Obser wrote:
> I'm chasing a bug in IPv6 where ndp reports an entry as (incomplete)
> but when you try to reach that target no neighbor solicitation is
> send.
> 
> I think the reason for that is that no new nd6_timer is scheduled
> because the code thinks it is already scheduled. Maybe. I'm having a
> hard time reproducing this. The stars need to align just right or
> something.
> 
> nd6_llinfo_settimer() does the following accounting:
> 
>       if (!timeout_pending(&nd6_timer_to) || expire < nd6_timer_next) {
>               nd6_timer_next = expire;
>               timeout_add_sec(&nd6_timer_to, secs);
>       }
> 
> i.e. it keeps track of when the timeout will fire in nd6_timer_next.
> 
> However, when the timeout fires and nd6_timer() runs it works out when
> to schedule the next timeout, but it doesn't keep track of when that
> is.
> 
> This seems better, I have no idea if it improves things though.
> 
> While here change nd_timer_next to time_t because seing an int there
> made my skin crawl. It probably doesn't matter though.
> 
> Test? Comments? OKs?
> 
> diff --git netinet6/nd6.c netinet6/nd6.c
> index bce15ad5135..a123d4e2f93 100644
> --- netinet6/nd6.c
> +++ netinet6/nd6.c
> @@ -67,7 +67,7 @@
>  #define ND6_RECALC_REACHTM_INTERVAL (60 * 120) /* 2 hours */
>  
>  /* timer values */
> -int  nd6_timer_next  = -1;   /* at which time_uptime nd6_timer runs */
> +time_t       nd6_timer_next  = -1;   /* at which time_uptime nd6_timer runs 
> */
>  time_t       nd6_expire_next = -1;   /* at which time_uptime nd6_expire runs 
> */
>  int  nd6_delay       = 5;    /* delay first probe time 5 second */
>  int  nd6_umaxtries   = 3;    /* maximum unicast query */
> @@ -336,8 +336,10 @@ nd6_timer(void *arg)
>       secs = expire - time_uptime;
>       if (secs < 0)
>               secs = 0;
> -     if (!TAILQ_EMPTY(&nd6_list))
> +     if (!TAILQ_EMPTY(&nd6_list)) {
> +             nd6_timer_next = time_uptime + secs;
>               timeout_add_sec(&nd6_timer_to, secs);
> +     }
>  
>       NET_UNLOCK();
>  }
> 
> -- 
> I'm not entirely sure you are real.
> 

-- 
I'm not entirely sure you are real.

Reply via email to