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

From: Brian Haley <[email-masked]>
Date: Fri, 02 Feb 2007 16:28:01 -0500

Hi Neil,

> @@ -830,7 +836,8 @@ retry:
>  	ift = !max_addresses ||
>  	      ipv6_count_addresses(idev) < max_addresses ? 
>  		ipv6_add_addr(idev, &addr, tmp_plen,
> -			      ipv6_addr_type(&addr)&IPV6_ADDR_SCOPE_MASK, IFA_F_TEMPORARY) : NULL;
> +			      ipv6_addr_type(&addr)&IPV6_ADDR_SCOPE_MASK, 
> +			      IFA_F_TEMPORARY|IFA_F_OPTIMISTIC) : NULL;

So why are you always adding these as optimistic now?  Shouldn't this be 
triggering off idev->cnf.optimistic_dad?  I know you're clearing it in 
ipv6_add_addr(), but I liked Vlad's suggestion of not setting it 
initially since this way seems backwards.

> @@ -2123,7 +2142,8 @@ static void addrconf_add_linklocal(struct inet6_dev *idev, struct in6_addr *addr
>  {
>  	struct inet6_ifaddr * ifp;
>  
> -	ifp = ipv6_add_addr(idev, addr, 64, IFA_LINK, IFA_F_PERMANENT);
> +	ifp = ipv6_add_addr(idev, addr, 64, IFA_LINK, 
> +		            IFA_F_PERMANENT|IFA_F_OPTIMISTIC);

Here too.

-Brian