All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
Cc: davem@davemloft.net, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi,
	jmorris@namei.org, kaber@coreworks.de, netdev@vger.kernel.org
Subject: Re: [PATCH] IPv6: Implement RFC 4429 Optimistic Duplicate Address Detection
Date: Fri, 19 Jan 2007 20:41:37 -0500	[thread overview]
Message-ID: <20070120014137.GA13598@hmsreliant.homelinux.net> (raw)
In-Reply-To: <20070120.080507.25118874.yoshfuji@linux-ipv6.org>

On Sat, Jan 20, 2007 at 08:05:07AM +0900, YOSHIFUJI Hideaki / 吉藤英明 wrote:
> Hello.
> 
> In article <20070119212314.GA10748@hmsreliant.homelinux.net> (at Fri, 19 Jan 2007 16:23:14 -0500), Neil Horman <nhorman@tuxdriver.com> says:
> 
> > Patch to Implement IPv6 RFC 4429 (Optimistic Duplicate Address Detection).  In
> 
> Good work.  We will see if this would break core and basic ipv6 code.
> Dave, please hold on.
> 
Thank you.  I'll implement your requested changes and repost monday afternoon
Regards
Neil

> Some quick comments.
> 
> > --- a/include/net/ipv6.h
> > +++ b/include/net/ipv6.h
> > @@ -110,6 +110,7 @@ struct frag_hdr {
> >  /* sysctls */
> >  extern int sysctl_ipv6_bindv6only;
> >  extern int sysctl_mld_max_msf;
> > +extern int sysctl_optimistic_dad;
> >  
> :
> > diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> > index 2a7e461..f7afb2a 100644
> > --- a/net/ipv6/addrconf.c
> > +++ b/net/ipv6/addrconf.c
> > @@ -206,6 +206,8 @@ static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = {
> >  	.proxy_ndp		= 0,
> >  };
> >  
> > +int sysctl_optimistic_dad = 1;
> > +
> 
> Please put this into ipv6_devconf{} and make it per-interface variable.
> And I think default should be kept off (0).
> 
> >  /* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */
> >  #if 0
> >  const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
> > @@ -830,7 +832,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;
> >  	if (!ift || IS_ERR(ift)) {
> >  		in6_ifa_put(ifp);
> >  		in6_dev_put(idev);
> 
> Please align ipv6_addr_type and IFA_F_TEMPORARY
> 
> > @@ -1174,7 +1177,8 @@ int ipv6_get_saddr(struct dst_entry *dst,
> >  }
> >  
> >  
> > -int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr)
> > +int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr, 
> > +			unsigned char banned_flags)
> >  {
> >  	struct inet6_dev *idev;
> >  	int err = -EADDRNOTAVAIL;
> 
> Please align "struct net_device" and "unsigned char".
> 
> > @@ -1185,7 +1189,7 @@ int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr)
> >  
> >  		read_lock_bh(&idev->lock);
> >  		for (ifp=idev->addr_list; ifp; ifp=ifp->if_next) {
> > -			if (ifp->scope == IFA_LINK && !(ifp->flags&IFA_F_TENTATIVE)) {
> > +			if (ifp->scope == IFA_LINK && !(ifp->flags&banned_flags)) {
> >  				ipv6_addr_copy(addr, &ifp->addr);
> >  				err = 0;
> >  				break;
> > @@ -1742,7 +1746,7 @@ ok:
> 
> It is not your fault, but please put a space around "&".
> 
> >  			if (!max_addresses ||
> >  			    ipv6_count_addresses(in6_dev) < max_addresses)
> >  				ifp = ipv6_add_addr(in6_dev, &addr, pinfo->prefix_len,
> > -						    addr_type&IPV6_ADDR_SCOPE_MASK, 0);
> > +						    addr_type&IPV6_ADDR_SCOPE_MASK,0);
> >  
> >  			if (!ifp || IS_ERR(ifp)) {
> >  				in6_dev_put(in6_dev);
> 
> Please do no kill space after ",".
> 
> > @@ -2123,7 +2132,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);
> >  	if (!IS_ERR(ifp)) {
> >  		addrconf_dad_start(ifp, 0);
> >  		in6_ifa_put(ifp);
> 
> Please align idev and IFA_F_PERMANENT.
> 
> > @@ -542,7 +556,8 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
> >  	int send_llinfo;
> >  
> >  	if (saddr == NULL) {
> > -		if (ipv6_get_lladdr(dev, &addr_buf))
> > +		if (ipv6_get_lladdr(dev, &addr_buf,
> > +			(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC)))
> >  			return;
> >  		saddr = &addr_buf;
> >  	}
> 
> ditto... ("dev" and "(")
> 
> > +			   and optimistic) are false then we can just fail
> > +			   dad now.
> > +			*/
> > +			type = ipv6_addr_type(saddr);			
> > +			if (!((ifp->flags & IFA_F_OPTIMISTIC) && 
> > +			    (type & IPV6_ADDR_UNICAST))) {
> > +				addrconf_dad_failure(ifp); 
> > +				return;
> > +			}
> >  		}
> >  
> >  		idev = ifp->idev;
> 
> hmm? Here, is saddr always unicast, isn't it?!
> 
> --yoshfuji

  reply	other threads:[~2007-01-20  1:42 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-19 21:23 [PATCH] IPv6: Implement RFC 4429 Optimistic Duplicate Address Detection Neil Horman
2007-01-19 23:05 ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-20  1:41   ` Neil Horman [this message]
2007-01-22 18:15   ` Neil Horman
2007-01-22 18:39     ` Mika Penttilä
2007-01-22 19:45       ` Neil Horman
2007-01-22 20:25         ` Vlad Yasevich
2007-01-23 18:36           ` Neil Horman
2007-01-23 19:27             ` Vlad Yasevich
2007-01-23  0:18     ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-23 20:51       ` Neil Horman
2007-01-25  1:54         ` Sridhar Samudrala
2007-01-25 13:33           ` Neil Horman
2007-01-25 17:16             ` Vlad Yasevich
2007-01-25 19:45               ` Neil Horman
2007-01-25 20:18                 ` Vlad Yasevich
2007-01-25 21:26                   ` Neil Horman
2007-01-25 22:13                     ` Vlad Yasevich
2007-01-26 14:27                       ` Neil Horman
2007-01-26 15:44                         ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-26 19:03                           ` Neil Horman
2007-01-25 22:34                     ` Vlad Yasevich
2007-01-26  0:13                 ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-26 14:20                   ` Vlad Yasevich
2007-01-26 19:18                   ` Neil Horman
2007-01-26 20:28                     ` Vlad Yasevich
2007-01-26 21:35                       ` Neil Horman
2007-01-26 21:42                         ` Vlad Yasevich
2007-01-29 16:34                           ` Neil Horman
2007-01-29 21:30                             ` Neil Horman
2007-01-29 22:25                               ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-30 13:02                                 ` Neil Horman
2007-01-30 16:16                                   ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-31 20:54                                     ` Neil Horman
2007-02-02 19:06                                       ` Neil Horman
2007-02-02 19:46                                         ` David Miller
2007-02-02 20:13                                           ` Neil Horman
2007-02-02 22:22                                             ` Vlad Yasevich
2007-02-03 15:06                                               ` Neil Horman
2007-02-02 21:28                                         ` Brian Haley
2007-02-02 22:05                                           ` Vlad Yasevich
2007-02-02 23:57                                             ` Brian Haley
2007-02-03 15:05                                               ` Neil Horman
2007-02-05 17:33                                                 ` Brian Haley
2007-02-05 18:37                                                   ` Neil Horman
2007-02-02 21:50                                         ` Vlad Yasevich
2007-02-03 15:03                                           ` Neil Horman
     [not found]                                             ` <20070205205651.GB484@hmsreliant.homelinux.net>
2007-02-06  1:24                                               ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-06  1:32                                                 ` David Miller
2007-02-06  1:44                                                   ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-06  1:43                                                     ` David Miller
2007-02-06 12:51                                                 ` Neil Horman
2007-02-06 20:09                                                   ` Neil Horman
2007-02-06 21:13                                                     ` Vlad Yasevich
2007-02-07 20:55                                                       ` Neil Horman
2007-02-07 21:19                                                         ` Vlad Yasevich
2007-02-07 21:52                                                         ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-08 13:07                                                           ` Neil Horman
2007-02-12 23:27                                                             ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-13 18:22                                                               ` Neil Horman
2007-02-07 22:26                                                         ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-08 16:41                                                           ` Neil Horman
2007-02-08 17:10                                                             ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-08 19:32                                                               ` Neil Horman
2007-02-12 21:20                                                                 ` Neil Horman
2007-02-13 20:45                                                                   ` Neil Horman
2007-02-13 21:46                                                                     ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-13 21:53                                                                       ` David Miller
     [not found]                                                                       ` <20070221.040259.60395625.yoshfuji@linux-ipv6.org>
     [not found]                                                                         ` <20070221.000222.71087924.davem@davemloft.net>
2007-02-21  8:15                                                                           ` YOSHIFUJI Hideaki / 吉藤英明
2007-02-21  9:30                                                                             ` David Miller
2007-02-21 13:37                                                                               ` Neil Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070120014137.GA13598@hmsreliant.homelinux.net \
    --to=nhorman@tuxdriver.com \
    --cc=davem@davemloft.net \
    --cc=jmorris@namei.org \
    --cc=kaber@coreworks.de \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.org \
    --cc=pekkas@netcore.fi \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.