On Mon, Aug 07, 2017 at 08:07:33AM +0000, Florian Obser wrote:
> index cafdd9fe36f..7796af6191c 100644
> --- sys/netinet6/in6.c
> +++ sys/netinet6/in6.c
> @@ -686,6 +686,10 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq 
> *ifra,
>        */
>       ia6->ia6_flags = ifra->ifra_flags;
>  
> +     KERNEL_LOCK();  
> +     nd6_expire_timer_update(ia6);
> +     KERNEL_UNLOCK();
> +

Can we ever reach this code without holding the kernel lock?

> +     if (!timeout_pending(&nd6_expire_timeout) || nd6_expire_time >
> +         expire_time) {
> +             expire_time++; /* fire one second after expiry */

Why do we need this and why do we do it after the
"nd6_expire_time > expire_time" check?

>                       /* check address lifetime */
>                       if (IFA6_IS_INVALID(ia6)) {
>                               in6_purgeaddr(&ia6->ia_ifa);
> -                     } else if (IFA6_IS_DEPRECATED(ia6)) {
> -                             ia6->ia6_flags |= IN6_IFF_DEPRECATED;
>                       } else {
> -                             /*
> -                              * A new RA might have made a deprecated address
> -                              * preferred.
> -                              */
> -                             ia6->ia6_flags &= ~IN6_IFF_DEPRECATED;
> +                             if (IFA6_IS_DEPRECATED(ia6))
> +                                     ia6->ia6_flags |= IN6_IFF_DEPRECATED;
> +                             nd6_expire_timer_update(ia6);

Why is "ia6_flags &= ~IN6_IFF_DEPRECATED" removed?
And where is the IN6_IFF_DEPRECATED flag cleared now?

bluhm

Reply via email to