Hi Neil

> @@ -1027,15 +1029,17 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
>                               }
>                       }
>  
> -                     /* Rule 3: Avoid deprecated address */
> +                     /* Rule 3: Avoid deprecated and optimistic address */
>                       if (hiscore.rule < 3) {
>                               if (ipv6_saddr_preferred(hiscore.addr_type) ||
> -                                 !(ifa_result->flags & IFA_F_DEPRECATED))
> +                                 ((!(ifa_result->flags & IFA_F_DEPRECATED)) 
> && 
> +                                 (!(ifa_result->flags & IFA_F_OPTIMISTIC))))

One style comment.  Looks like some extra parenthesis that I don't thing are 
needed.
I think you can say

+                                   (!(ifa_result->flags & IFA_F_DEPRECATED)) 
&& 
+                                    !(ifa_result->flags & IFA_F_OPTIMISTIC))))


>                                       hiscore.attrs |= 
> IPV6_SADDR_SCORE_PREFERRED;
>                               hiscore.rule++;
>                       }
>                       if (ipv6_saddr_preferred(score.addr_type) ||
> -                         !(ifa->flags & IFA_F_DEPRECATED)) {
> +                         ((!(ifa->flags & IFA_F_DEPRECATED)) &&
> +                         (!(ifa_result->flags & IFA_F_OPTIMISTIC)))) {

same here.

>                               score.attrs |= IPV6_SADDR_SCORE_PREFERRED;
>                               if (!(hiscore.attrs & 
> IPV6_SADDR_SCORE_PREFERRED)) {
>                                       score.rule = 3;

-vlad

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to