Subject: Re: [PATCH] IPv6: Implement RFC 4429 Optimistic Duplicate Address Detection

From: Vlad Yasevich <[email-masked]>
Date: Thu, 25 Jan 2007 15:18:59 -0500

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